Skip to content

getAuthDetails

getAuthDetails currently does not have a return value.

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

Usage

ts
import { createFordefiSigner } from "./fordefi";

const fordefiSigner = await createFordefiSigner();

const details = await fordefiSigner.getAuthDetails();
ts
import { FordefiSigner } from "@alchemy/aa-signers/fordefi";
import { FordefiWeb3Provider } from "@fordefi/web3-provider";

const fordefi = new FordefiWeb3Provider({
  address: "0x1234567890123456789012345678901234567890",
  chainId: 11155111,
  apiUserToken: process.env.FORDEFI_API_USER_TOKEN!,
  apiPayloadSignKey: process.env.FORDEFI_API_PAYLOAD_SIGNING_KEY!,
});

export const createFordefiSigner = async () => {
  const fordefiSigner = new FordefiSigner(fordefi);

  await fordefiSigner.authenticate();

  return fordefiSigner;
};

Returns

Promise<void>

Verifies that this signer is authenticated, and throws an error otherwise. Authentication details are not available.