Sign Message

Personal Sign

1440 1440

If a user is logged in to the Face Wallet, the user can sign the message from the wallet using Ethers.js. When signing the message, the user confirms the message to sign through the Face Wallet modal then enters the PIN code.

import { Face, Network } from '@haechi-labs/face-sdk';
import { ethers } from 'ethers';

const face = new Face({
  network: Network.BORA_TESTNET, 
  apiKey: 'YOUR_DAPP_API_KEY'
});
const provider = new ethers.providers.Web3Provider(face.getEthLikeProvider());
const signer = provider.getSigner();

const originalMessage = 'YOUR_MESSAGE_TO_SIGN';
const signedMessage = await signer.signMessage(originalMessage);