suix_getStakesByIds - Sui

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

This method returns stake details for specific StakedSui object IDs on the SUI network. Unlike suix_getStakes which returns all stakes for an address, this method retrieves data for specific stake objects when you already know their IDs.

Parameters

Parameter
Type
Required
Description

staked_sui_ids

array

Yes

Array of StakedSui object IDs

Request Example

curl.sh
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "suix_getStakesByIds",
  "params": [
    [
      "0x378423de90ed03b694cecf443c72b5387b29a731d26d98108d7abc4902107d7d",
      "0x6a8e0f8fea6fda5488462e58724c034462b6064a08845e2ae2942fe7c4ee816d"
    ]
  ]
}'

Response Example

Response Parameters

Parameter
Type
Description

validatorAddress

string

Validator address

stakingPool

string

Staking pool ID

stakedSuiId

string

Stake object ID

principal

string

Staked amount

status

string

Active, Pending, or Unstaked

estimatedReward

string

Estimated rewards

Use Cases

  • Query specific stake objects efficiently

  • Track individual stake positions

  • Verify stake object ownership

  • Build stake management tools

Error Handling

Error Code
Description

-32602

Invalid params - malformed IDs

-32603

Internal error - node issues

SDK Integration

Last updated

Was this helpful?