Learn to withdraw from Suilend protocool
"withdraw 1 ssui"
// Withdraw 1 sSUI { amount: 1; symbol: 'ssui'; }
import { SuiAgentKit } from "@getnimbus/sui-agent-kit"; async function withdrawSuilend(agent: SuiAgentKit) { try { const result = await agent.withdrawSuilend({ type: "UNSTAKING", amount: 1, symbol: "ssui", }); console.log("Result:", result); } catch (error) { console.error("Withdraw failed:", error); } }
// Successful response { tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM", tx_status: "success", } // Error response { tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM", tx_status: "failed", }
try { const res = await agent.lendingSuilend({ type: "UNSTAKING", amount: 1, symbol: "ssui", }); } catch (error) { // Handle error }