Agent deployment
activateAgent
Activates the user's smart wallet for one or more agents. This deploys the Safe contract and creates a session key if not already set up, then stores the selected chainId for later SDK calls.
- If
agentIdis omitted: activates all agents that support the specified chain. - If
agentIdis provided: activates only the listed agents. - If any explicitly listed agent does not support the chain, the call throws before activating any of them.
Requires wallet connection: Yes
- Signature
- Example
activateAgent(
chainId: number,
agentId?: AgentId[]
): Promise<void>
await owney.activateAgent(8453);
Parameters
chainId: number- Target chain ID (SeeAgent Compatibilityfor details).agentId?: AgentId[]- Optional list of agents to activate (SeeAgentIdfor details). If omitted, all chain-compatible agents are activated. An empty array is invalid.
Returns
Promise<void>
getActiveChainId
Returns the active chain ID currently set by activateAgent.
- Signature
- Example
- Example Output
getActiveChainId(): number | null
const chainId = owney.getActiveChainId();
console.log(chainId);
8453
Returns
number | null- The active chain ID, ornullif no chain has been activated yet.