Skip to content
Alchemy Logo

watchSmartWalletClient

function watchSmartWalletClient(config): (onChange) => any;

Defined in: account-kit/core/src/actions/watchSmartWalletClient.ts:29

Creates a subscription function that watches for changes to the Smart Wallet Client. Triggers the onChange callback whenever the signer status or chain changes.

import { watchSmartWalletClient } from "@account-kit/core";
// see createConfig for more information on how to create a config
import { config } from "./config.js";
 
const watchClient = watchSmartWalletClient(config);
const unsubscribe = watchClient((client) => {
  console.log("Smart Wallet Client changed:", client);
});
 
// Clean up subscription
unsubscribe();

ParameterTypeDescription

config

AlchemyAccountsConfig

The configuration containing the client store and connection information

A function that accepts an onChange callback and returns an unsubscribe function

(onChange): any;

ParameterType

onChange

(client) => void

any

Was this page helpful?