Skip to content
Alchemy Logo

useSolanaSignMessage

function useSolanaSignMessage(opts): SolanaSignedMessage;

Defined in: account-kit/react/src/hooks/useSolanaSignMessage.ts:65

This is the hook that will be used to sign a message. It will prioritize external connected Solana wallets, falling back to the internal signer when not connected.

import { useSolanaSignMessage } from "@account-kit/react";
 
const {
  isPending: isSigningMessage,
  mutate: signHello,
  data: signature,
  reset,
} = useSolanaSignMessage({});
 
signHello({ message: "Hello" });

ParameterTypeDescription

opts

UseSolanaSignMessageParams

Options for the hook to get setup.

SolanaSignedMessage

This should be hook mutations plus a few more. Used to get the end result of the signing and the callbacks.

Was this page helpful?