import { isBitcoinWalletAccount, signMessageWithCustomOptions } from '@dynamic-labs-sdk/bitcoin';
const SignMessageButton = ({ walletAccount }) => {
const onSignMessage = async () => {
if (!isBitcoinWalletAccount(walletAccount)) {
return;
}
// The `addressType` can be 'payment' or 'ordinals'
// The `protocol` can be 'ecdsa' or 'bip322-simple'
const { signature } = await signMessageWithCustomOptions({
walletAccount,
message: 'example',
addressType: 'ADDRESS_TYPE',
protocol: 'PROTOCOL',
});
console.log('signature', signature);
};
return <button onClick={onSignMessage}>Sign message</button>;
};