Skip to content

getAddress

Asynchronously retrieves addresses from the inner object and returns the first address after applying the getAddress function.

Import

import { WalletClientSigner } from "@aa-sdk/core";

Usage

import { WalletClientSigner } from "@aa-sdk/core";
import { createWalletClient, custom } from "viem";
import { mainnet } from "viem/chains";
 
const client = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!),
});
 
const signer = new WalletClientSigner(client, "wallet");
console.log(await signer.getAddress());

Returns

Promise<string> A promise that resolves to the first address after being processed by the getAddress function.