Skip to content

getSignerType

Determines the type of signer (Externally Owned Account (EOA) or CONTRACT) based on the provided client, signature, and signer.

Import

import { getSignerType } from "@account-kit/smart-contracts";

Usage

import { getSignerType } from "@account-kit/smart-contracts";
import { LocalAccountSigner } from "@aa-sdk/core";
import { createPublicClient, generatePrivateKey } from "viem";
 
const signer = LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey());
const client = createPublicClient(...);
const signature = signer.signMessage("Hello World");
 
const signerType = await getSignerType({ client, signature, signer }); // EOA

Parameters

params

GetSignerTypeParams<TTransport, TChain> the parameters including the client, signature, and signer

Returns

Promise<SignerType> A promise that resolves to the signer type, which is either "EOA" or "CONTRACT"