Overview
A Staking Operation is a list of transactions that need to be signed and broadcasted sequentially in order to complete a staking action such as stake, unstake etc.Staking Operation Lifecycle
Performing any staking activity within the Staking API initiates a Staking Operation. This triggers an asynchronous process behind the scenes that constructs the required transactions for the staking action you specified (ex: stake, unstake, etc). For some networks, you might be presented with a single transaction, while for others, there might be multiple. These transactions might be available immediately or after necessary infrastructure setup that can take longer. Regardless of the network or the type of staking, your interaction with the Staking Operation remains consistent. Your only responsibility is to sign and broadcast the presented transactions as they become available. Here’s an example of how you can start a staking operation.Staking Operation States
A staking operation can have the following states:| State | Definition | Terminal State |
|---|---|---|
| initialized | The staking operation has been initialized. Behind the scenes, the necessary transactions and/or infrastructure are being created. | False |
| complete | The staking operation is now complete and has no more transactions to create. | True |
| failed | The staking operation has failed. | True |
FAQs
How do I know when a staking operation is complete?
You can poll the staking operation until it reaches a terminal state ofcomplete or failed.
The SDK provides the wait helper method to make this process easier.