Skip to content
Alchemy Logo

watchSmartAccountClient

function watchSmartAccountClient<TAccount, TChain>(
  params,
  config,
): (onChange) => any;

Defined in: account-kit/core/src/actions/watchSmartAccountClient.ts:33

Watches for changes to the smart account client and triggers the provided callback when a change is detected.

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

Type ParameterDefault typeDescription

TAccount extends SupportedAccountTypes

extends SupportedAccountTypes

TChain extends undefined | Chain

undefined | Chain

extends Chain | undefined = Chain | undefined

ParameterTypeDescription

params

GetSmartAccountClientParams<TChain, TAccount>

the parameters needed to get the smart account client

config

AlchemyAccountsConfig

the configuration containing the client store and other settings

a function that accepts a callback to be called when the client changes and returns a function to unsubscribe from the store

(onChange): any;

ParameterType

onChange

(client) => void

any

Was this page helpful?