Skip to content

watchSignerStatus

Watches the signer status in the client store and triggers the provided callback function when the status changes.

Import

import { watchSignerStatus } from "@account-kit/core";

Usage

import { watchSignerStatus } from "@account-kit/core";
// see createConfig for more information on how to create a config
import { config } from "./config";
 
watchSignerStatus(config)(console.log);

Parameters

config

AlchemyAccountsConfig The configuration object containing the client store

Returns

(onChange: (status: SignerStatus) => void) => (() => void) A function that accepts a callback to be called when the signer status changes which returns a function to unsubscribe from the store