pauseAgent
Pause the agent by clearing all protocols. This sets the user's protocols to an empty array, effectively pausing automated operations. Requires SIWE authentication.
Signature
pauseAgent(): Promise<UpdateUserProfileResponse>
Returns
Response indicating success and updated user details
Return Type
interface UpdateUserProfileResponse {
success: boolean;
userId: string;
smartWallet?: string;
chains?: number[];
strategy?: string;
}
Example
await sdk.connectAccount(privateKey, chainId);
// Pause the agent
const result = await sdk.pauseAgent();
console.log("Agent paused:", result.success);
// Verify the agent is paused
const userDetails = await sdk.getUserDetails();
console.log("Active protocols:", userDetails.user.protocols.length); // Should be 0
Notes
- User must be authenticated (automatically done via
connectAccount()) - This sets the user's protocols to an empty array
- To resume operations, call
updateUserProfile()with the desired protocols - The agent will not perform automated yield optimization while paused