Skip to content

getAddress

getAddress returns the EOA address of the ArcanaAuthSigner.

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

Usage

ts
import { createArcanaAuthSigner } from "./arcana-auth";

const newArcanaAuthSigner = await createArcanaAuthSigner();

const address = await newArcanaAuthSigner.getAddress();
ts
import { ArcanaAuthSigner } from "@alchemy/aa-signers/arcana-auth";

// See https://docs.arcana.network/quick-start/vue-quick-start#step-3-integrate-app for details.
const clientId = "xar_test_...";

export const createArcanaAuthSigner = async () => {
  const arcanaAuthSigner = new ArcanaAuthSigner({ clientId, params: {} });

  await arcanaAuthSigner.authenticate({
    async init() {
      await arcanaAuthSigner.inner.init();
    },
    async connect() {
      await arcanaAuthSigner.inner.connect();
    },
  });

  return arcanaAuthSigner;
};

Returns

Promise<Address>

A Promise containing the address of the ArcanaAuthSigner.