Skip to content

getAuthDetails

getAuthDetails returns the details about the authenticated user, specifically all EOA addresses tied to the user's Portal vault.

This method must be called after authenticate. Otherwise, this method will throw an error with the message Not Authenticated.

Usage

ts
import { createPortalSigner } from "./portal";

const portalSigner = await createPortalSigner();

const details = await portalSigner.getAuthDetails();
ts
import { sepolia } from "@alchemy/aa-core";
import { PortalSigner } from "@alchemy/aa-signers/portal";

export const createPortalSigner = async () => {
  const portalSigner = new PortalSigner({
    autoApprove: true,
    gatewayConfig: `${sepolia.rpcUrls.alchemy.http}/${process.env.ALCHEMY_API_KEY}`,
    chainId: sepolia.id,
  });

  await portalSigner.authenticate();

  return portalSigner;
};

Returns

Promise<PortalUserInfo>

A Promise containing the PortalUserInfo, an object with the following fields:

  • id: string -- ID of the Portal Signer.
  • address: string -- EOA address of the Portal Signer.
  • backupStatus: string | null -- [optional] status of wallet backup.
  • custodian: Object -- [optional] EOA address of the Portal Signer.
    • id: string -- ID of the Signer's custodian.
    • name: string -- Name of the Signer's custodian.
  • signingStatus: string | null -- [optional] status of signing.

This derives from the return type of a Portal provider's getClient() method.