Skip to content

signMessage

signMessage supports signing messages from the FireblocksSigner.

This method must be called after authenticate. Otherwise, this method will throw an error with the message Not Authenticated.

Usage

ts
import { createFireblocksSigner } from "./fireblocks";

const fireblocksSigner = await createFireblocksSigner();

const signedMessage = await fireblocksSigner.signMessage("test");
ts
import { FireblocksSigner } from "@alchemy/aa-signers/fireblocks";
import { ChainId } from "@fireblocks/fireblocks-web3-provider";

export const createFireblocksSigner = async () => {
  const fireblocksSigner = new FireblocksSigner({
    privateKey: process.env.FIREBLOCKS_API_PRIVATE_KEY_PATH!,
    apiKey: process.env.FIREBLOCKS_API_KEY!,
    vaultAccountIds: process.env.FIREBLOCKS_VAULT_ACCOUNT_IDS,
    chainId: ChainId.SEPOLIA,
  });

  await fireblocksSigner.authenticate();

  return fireblocksSigner;
};

Returns

Promise<Hex>

A Promise containing the signature of the message.

Parameters

msg: string | Uint8Array) -- the message to sign