function useSmartWalletClient<TAccount>(
params,
): GetSmartWalletClientResult<TAccount>;Defined in: account-kit/react/src/hooks/useSmartWalletClient.ts:42
React hook that provides a Smart Wallet Client instance. Returns undefined if an EOA wallet is connected via wagmi, as Smart Wallet Clients are only for smart accounts. The hook automatically subscribes to changes in signer status and chain configuration.
import { useSmartWalletClient } from "@account-kit/react";
function MyComponent() {
const client = useSmartWalletClient();
// With specific account address
const clientWithAccount = useSmartWalletClient({
account: "0x1234...",
});
if (client) {
// Use the client for wallet operations
console.log("Smart Wallet Client ready:", client);
}
return <div>...</div>;
}| Type Parameter | Default type |
|---|---|
|
|
| Parameter | Type | Description |
|---|---|---|
|
| Parameters for getting the smart wallet client, including optional account address |
GetSmartWalletClientResult<TAccount>
The Smart Wallet Client instance or undefined if an EOA is connected or client is unavailable