suix_getStakes{deprecated} - Sui

This method returns all delegated stakes for an address on the SUI network, including validator addresses, stake amounts, activation epochs, and estimated rewards.

This method is deprecated

Parameters

ParameterTypeRequiredDescriptionDefault/Supported Values
ownerstringYesThe staker's SUI addressValid SUI address

Request Example

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
  "jsonrpc": "2.0",
  "method": "suix_getStakes",
  "params": ["0x9c76d5157eaa77c41a7bfda8db98a8e8080f7cb53b7313088ed085c73f866f21"],
  "id": "getblock.io"
}'
javascriptimport axios from 'axios';

const data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "suix_getStakes",
  "params": ["0x9c76d5157eaa77c41a7bfda8db98a8e8080f7cb53b7313088ed085c73f866f21"],
  "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => console.log(JSON.stringify(response.data)))
    .catch(error => console.log(error));
pythonimport requests
import json

url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"

payload = json.dumps({
  "jsonrpc": "2.0",
  "method": "suix_getStakes",
  "params": ["0x9c76d5157eaa77c41a7bfda8db98a8e8080f7cb53b7313088ed085c73f866f21"],
  "id": "getblock.io"
})

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)
rustuse reqwest::header;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header(header::CONTENT_TYPE, "application/json")
        .body(r#"{
              "jsonrpc": "2.0",
              "method": "suix_getStakes",
              "params": ["0x9c76d5157eaa77c41a7bfda8db98a8e8080f7cb53b7313088ed085c73f866f21"],
              "id": "getblock.io"
            }"#)
        .send()
        .await?;
    
    println!("{}", response.text().await?);
    Ok(())
}

Response

Response (truncated example)

json{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "result": [
    {
      "validatorAddress": "0x3befb84f03a24386492bd3b05b1fd386172eb450e5059ce7df0ea6d9d6cefcaa",
      "stakingPool": "0x9a95cf69368e31b4dbe8ee9bdb3c0587bbc79d8fc6edf4007e185a962fd906df",
      "stakes": [
        {
          "stakedSuiId": "0xb4eeb46b70f0bebcae832aeef9f7c5db76052ab656e5f81853d0cf701cdbc8eb",
          "stakeRequestEpoch": "62",
          "stakeActiveEpoch": "63",
          "principal": "200000000000",
          "status": "Active",
          "estimatedReward": "520000000"
        }
      ]
    }
  ]
}

Response Parameters

ParameterTypeDescription
result[].validatorAddressstringValidator's address
result[].stakingPoolstringStaking pool object ID
result[].stakes[].stakedSuiIdstringStaked SUI object ID
result[].stakes[].principalstringStaked amount in MIST
result[].stakes[].statusstringStake status (Pending, Active, Unstaked)
result[].stakes[].estimatedRewardstringEstimated reward in MIST

Use Cases

  1. Staking Dashboard

    Display user's complete staking portfolio with rewards.

  2. Reward Tracking

    Monitor accumulated staking rewards over time.

  3. Validator Analysis

    View stake distribution across validators.

Errors Handling

ErrorDescriptionSolution
Invalid AddressMalformed SUI addressVerify address format
Empty ResultNo stakes foundAddress may not have staked

SDK Integration

example.ts

typescriptimport { SuiClient } from '@mysten/sui/client';
const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const stakes = await client.getStakes({
  owner: '0x9c76d5157eaa77c41a7bfda8db98a8e8080f7cb53b7313088ed085c73f866f21'
});
console.log(stakes);