Learn to lend on Suilend protocool
"lend suilend 1 ssui"
// Lend 1 sSUI { amount: 1; symbol: 'ssui'; }
import { SuiAgentKit } from "@getnimbus/sui-agent-kit"; async function lendingSuilend(agent: SuiAgentKit) { try { const result = await agent.lendingSuilend({ type: "LENDING"; amount: 1, symbol: "ssui", }); 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.lendingSuilend({ type: "LENDING", amount: 1, symbol: "ssui", }); } catch (error) { if (error.message.includes("Insufficient balance")) { // Handle insufficient balance } else { // Handle other transaction failures } }