watchSignerStatus

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

Import

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

Usage

1import { watchSignerStatus } from "@account-kit/core";
2// see createConfig for more information on how to create a config
3import { config } from "./config";
4
5watchSignerStatus(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