BluxBlux

Sign Message

Request a signed message from the connected user using Blux.

The blux.signMessage() method prompts the connected user to sign an arbitrary message. Blux shows a confirmation modal displaying the message content and the signing account before the user approves.

Sign message modal

Type

type IOptions = {
  network?: string;
};

const signMessage: (message: string, options?: IOptions);
ParameterTypeDescription
messagestringThe message string to sign
options.networkstringNetwork to use — omit to use the active network

Usage

import { blux } from "@bluxcc/core";

const sign = async () => {
  try {
    const result = await blux.signMessage("Hello");

    console.log(result);
  } catch (error) {
    console.error("Something went wrong!");
    console.log(error);
  }
};

To skip the confirmation modal and handle your own confirmation UI, set showWalletUIs: false in createConfig.

On this page