Skip to main content

Method Signature

agent.deactivate(params: DeactivateParams): Promise<DeactivateResponse>

Description

Deactivates the agent, withdraws funds from all protocols, and optionally transfers them to the origin wallet.

Parameters

wallet
Address
required
Smart account address to deactivate.
transfer
boolean
default:"true"
Whether to transfer withdrawn funds to origin wallet.

Example

await giza.agent.deactivate({
  wallet: smartAccountAddress,
  transfer: true, // Transfer to origin wallet
});

// Poll for completion
const finalStatus = await giza.agent.pollWithdrawalStatus(
  smartAccountAddress,
  { interval: 5000, timeout: 300000 }
);