function useClientActions<TTransport, TChain, TActions>(
args,
): UseClientActionsResult<TActions>;Defined in: account-kit/react/src/hooks/useClientActions.ts:111
A hook that allows you to leverage client decorators to execute actions and await them in your UX. This is particularly useful for using Plugins with Modular Accounts.
import React from "react";
import { useSmartAccountClient } from "@account-kit/react";
import { sessionKeyPluginActions } from "@account-kit/smart-contracts";
import { useClientActions } from "@account-kit/react";
const Foo = () => {
const { client } = useSmartAccountClient({
type: "MultiOwnerModularAccount",
});
const { executeAction } = useClientActions({
client: client,
actions: sessionKeyPluginActions,
});
executeAction({
functionName: "isAccountSessionKey",
args: [{ key: "0x0" }],
});
};| Type Parameter | Default type |
|---|---|
| |
|
|
|
|
| Parameter | Type | Description |
|---|---|---|
|
| the hooks arguments highlighted below. ref |
UseClientActionsResult<TActions>
an object containing methods to execute the actions as well loading and error states ref