# suix_getStakes{deprecated} - Sui

> Example code for the suix_getStakes JSON-RPC method. Complete guide on how to use suix_getStakes JSON-RPC in GetBlock Web3 documentation.

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

> **Warning:** This method is deprecated

### Parameters

| Parameter | Type | Required | Description | Default/Supported Values |
| --- | --- | --- | --- | --- |
| owner | string | Yes | The staker's SUI address | Valid SUI address |

## Request Example

#### cURL

```bash
curl --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"
}'
```

#### Axios

```javascript
import 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));
```

#### Request

```python
import 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)
```

#### Rust

```rust
use 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

| Parameter | Type | Description |
| --- | --- | --- |
| result[].validatorAddress | string | Validator's address |
| result[].stakingPool | string | Staking pool object ID |
| result[].stakes[].stakedSuiId | string | Staked SUI object ID |
| result[].stakes[].principal | string | Staked amount in MIST |
| result[].stakes[].status | string | Stake status (Pending, Active, Unstaked) |
| result[].stakes[].estimatedReward | string | Estimated reward in MIST |

### Use Cases

1. Staking Dashboard

   Display user's complete staking portfolio with rewards.

1. Reward Tracking

   Monitor accumulated staking rewards over time.

1. Validator Analysis

   View stake distribution across validators.

### Errors Handling

| Error | Description | Solution |
| --- | --- | --- |
| Invalid Address | Malformed SUI address | Verify address format |
| Empty Result | No stakes found | Address may not have staked |

### SDK Integration

#### example.ts

```typescript
import { 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);
```
