Skip to content

Get Address Action

This simple action returns the public blockchain address of the agent’s smart account.

The LLM invokes this tool when asked:

  • “What is your wallet address?”
  • “Where can I send you some USDC?”
  • “Show me your public key.”

There are no arguments for this action.

import { Agentkit, GetAddressAction } from "@0xgasless/agentkit";
const agentkit = await Agentkit.configureWithWallet({
apiKey: "YOUR_API_KEY",
privateKey: process.env.PRIVATE_KEY as `0x${string}`,
chainID: 43114,
});
const action = new GetAddressAction();
const address = await agentkit.run(action, {});
console.log(address); // "0xYourAgentSmartAccountAddress"

This action simply calls client.smartAccountAddress. If the instance was initialized with an existing OxGasClient instance from an embedded wallet user, it returns that user’s smart account address.