BluxBlux

Sign Message

Request a signed message from the user's wallet using the Blux SDK.

Use signMessage from the useBlux hook to request a message signature from the connected user's wallet. This is useful for verifying ownership of an account without submitting a transaction.

Import

import { useBlux } from "@bluxcc/react";

Usage

import { useBlux } from "@bluxcc/react";

function SignButton() {
  const { signMessage } = useBlux();

  const handleSign = async () => {
    try {
      const signature = await signMessage("Hello from Blux!");
      console.log("Signature:", signature);
    } catch (error) {
      console.error("Signing failed:", error);
    }
  };

  return <button onClick={handleSign}>Sign Message</button>;
}

Screenshots

Sign Message modal

On this page