Learn to stake LST to Suilend protocool
"stake suilend 1 msui"
// Stake 1 SUI { amount: 1; symbol: 'msui'; }
import { SuiAgentKit } from "@getnimbus/sui-agent-kit"; async function stakeSuilend(agent: SuiAgentKit) { try { const result = await agent.stakeSuilend({ type: "STAKING", amount: 1, symbol: "msui", }); console.log("Result:", result); } catch (error) { console.error("Stake failed:", error); } }
// Successful response { tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM", tx_status: "success", } // Error response { tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM", tx_status: "failed", }
try { const res = await agent.stakeSuilend({ type: "STAKING", amount: 1, symbol: "msui", }); } catch (error) { if (error.message.includes("Insufficient balance")) { // Handle insufficient balance } else { // Handle other transaction failures } }