Learn how to unstake SUI - native staking
Unstake your SUI native staking
// Unstake const stakedSuiId = '0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623' const result = await agent.unstake(stakedSuiId);
"unstake this position 0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623"
{ "stakedSuiId": "0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623", }
import { SuiAgentKit } from "@getnimbus/sui-agent-kit"; async function unStake(agent: SuiAgentKit) { try { const stakeId = "0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623"; const result = await agent.unStake(stakeId); console.log("Unstake result:", result); } catch (error) { console.error("Unstake failed:", error); } }
sui system
// Successful response { tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM", tx_status: "success", } // Error response { tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM", tx_status: "failed", }
try { const stakeId = "0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623"; const result = await agent.unStake(stakeId); } catch (error) { if (error.message.includes("Insufficient balance")) { // Handle insufficient balance } else { // Handle other transaction failures } }