Actalink Docs
Hooks

useSIWE Hook

Hook for getting SIWE logic.

Import

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

Usage

import { useSIWE } from "@actalink/react-hooks";
import { useAccount } from "wagmi";
import { config } from "../wagmi"; // import wagmi config
 
const Home: NextPage = () => {
  const { address, status, chainId } = useAccount();
  const { fetchSIWEToken } = useSIWE({ eoaAddress: address, eoaStatus: status, chainId: chainId, config: config });
  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
fetchSIWEToken(paymasterUrl: string) ⇒ Promise<any>- function to challenge and sign SIWE message with connected EOA account

On this page