getOwnerAddress
getOwnerAddress
returns the address of the on-chain owner of the account.
Usage
ts
import { smartAccountClient } from "./smartAccountClient";
// get on-chain account owner address
const ownerAddress = await smartAccountClient.account.getOwnerAddress();
ts
import {
createLightAccount,
lightAccountClientActions,
} from "@alchemy/aa-accounts";
import {
LocalAccountSigner,
SmartAccountSigner,
createSmartAccountClient,
polygonMumbai,
} from "@alchemy/aa-core";
import { http } from "viem";
export const chain = polygonMumbai;
export const signer: SmartAccountSigner =
LocalAccountSigner.mnemonicToAccountSigner("YOUR_OWNER_MNEMONIC");
export const rpcTransport = http(
"https://polygon-mumbai.g.alchemy.com/v2/demo"
);
export const smartAccountClient = createSmartAccountClient({
transport: rpcTransport,
chain,
account: await createLightAccount({
transport: rpcTransport,
chain,
signer,
}),
}).extend(lightAccountClientActions);
Returns
Promise<Address>
A Promise
containing the address of the smart account's owner address.