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();| Parameter | Type | Description |
|---|---|---|
|
| The configuration containing the client store and connection information |
A function that accepts an onChange callback and returns an unsubscribe function
(onChange): any;| Parameter | Type |
|---|---|
| ( |
any