Staking Flow
Before interacting with the API methods, it is useful to understand how native staking works on Sui.
Sui staking follows an object-based model. A wallet stakes SUI into a validator staking pool and receives stake-related on-chain objects. Unstaking is performed using the specific StakedSui object identifier.
All staking operations are executed on-chain. The Stakely Staking API crafts the required transactions, while signing and broadcasting are handled by your application.
Stake
Staking delegates a specified amount of SUI to a validator.
- Initiate Stake: Use the stake action to create a transaction that stakes a chosen amount to a validator.
- Transaction Confirmation: Once the transaction is confirmed on-chain, your stake position is created.
- Stake Objects: The wallet can then query staked positions and balances.
Unstake
Unstaking starts the process of withdrawing stake from an existing StakedSui object.
- Select Staked Object: Identify the
staked_sui_object_idto unstake. - Initiate Unstake: Use the unstake action to craft an unstake transaction.
- Transaction Confirmation: Once confirmed on-chain, the unstake operation is applied.