Documentation Index
Fetch the complete documentation index at: https://docs.getnimbus.io/llms.txt
Use this file to discover all available pages before exploring further.
Unstake your SUI native staking
Usage
// Unstake
const stakedSuiId = '0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623'
const result = await agent.unstake(stakedSuiId);
Parameters
| Parameter | Type | Required | Description |
|---|
| stakedSuiId | string | Yes | StakedID of the position to unstake |
Example Prompts
Natural Language Prompts
"unstake this position 0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623"
{
"stakedSuiId": "0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623",
}
Example Implementation
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);
}
}
Implementation Details
- Uses
sui system for unstaking
- Automatically handles transaction versioning
- Includes proper transaction confirmation
- Remove liquid staking position
// Successful response
{
tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
tx_status: "success",
}
// Error response
{
tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
tx_status: "failed",
}
Error Handling
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
}
}
Best Practices
- Gas Verification
- Account for transaction fees
- Transaction Management
- Monitor transaction status
- Implement proper error handling
- Use appropriate commitment levels
- Security
- Verify transaction details
- Double-check amounts
- Keep private keys secure
- User Experience
- Show transaction progress
- Display staking rewards
- get_holding: Check token balances