watchSmartAccountClient

1function watchSmartAccountClient<TAccount, TChain>(
2 params,
3 config,
4): (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.

Example

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

Type Parameters

Type ParameterDefault typeDescription

TAccount extends SupportedAccountTypes

extends SupportedAccountTypes

TChain extends undefined | Chain

undefined | Chain

extends Chain | undefined = Chain | undefined

Parameters

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

Returns

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

1(onChange): any;

Parameters

ParameterType

onChange

(client) => void

Returns

any