Actalink Docs
Hooks

useActaAccount Hook

Hook for getting Actalink smart account instance.

Import

import { useActaAccount } from "@actalink/react-hooks";

Usage

import { useActaAccount } from "@actalink/react-hooks";
import { useAccount } from "wagmi";
import { config } from "../wagmi"; // import wagmi config
import { validators} from './constants'
 
const Home: NextPage = () => {
  const { address, status, chainId } = useAccount();
  const { address: swAddress, actaAccount, error } = useActaAccount({ eoaAddress: address, eoaStatus: status, chainId: chainId, config: config, validators });
  return()
}

Parameters

ParameterTypeDefinition
eoaAddressAddressEOA address of the connected wallet.
eoaStatus"connected", "disconnected", "reconnecting", "connecting"Connection status of the EOA wallet.
chainIdnumberChainId of network to which the dapp is connected.
configConfigwagmi config.

Returns

ValueReturn TypeDefinition
addressAddressIt returns smart wallet address.
actaAccountActalinkSmartAccountActalink smart wallet instance to get smart wallet related methods like getAddress(), getNonce and many more.
status"loaded", "loading", "not available"Loading status of smart wallet. config.
saltHexReturns a unique value of salt.
errorstringError variable, if there is any error for smart wallet.

On this page