Check your native staking

Usage

// Get native staking
const result = await agent.getStake();

Parameters

No

Example Prompts

Natural Language Prompts

"get my native staking"

Example Implementation

import { SuiAgentKit } from "@getnimbus/sui-agent-kit";

async function getStake(agent: SuiAgentKit) {
  try {
    const result = await agent.getStake();
    console.log("Stake list:", result);
  } catch (error) {
    console.error("Get stake failed:", error);
  }
}

Implementation Details

  • Read your native staking on chain

Response Format

// Successful response
[
  {
    "validatorAddress": "0x00ae78d3e5ba5d6b8de32455474f52811b95617cbad39ebf4f9e2daf67187407",
    "stakingPool": "0x3b29dc1e8e7e9e358e21c93d5ecb61f94ade7f9a39a944dd3396bacb29cbc9ed",
    "stakes": [
      {
        "stakedSuiId": "0xb73a5f2fc8ee3ca60f5efcd93242921e7138ab25f02df1d59c45d94d96411623",
        "stakeRequestEpoch": "672",
        "stakeActiveEpoch": "673",
        "principal": "1000000000",
        "status": "Pending"
      }
    ]
  }
]

// Error response
{
  throw new Error
}

Error Handling

try {
  const result = await agent.getStake(amount, poolId);
} catch (error) {
  // Handle error
}