Creates a StakingOperation object.
The staking operation response from the API call.
Private
modelPrivate
Readonly
transactionsGet the status of the staking operation.
The status of the staking operation.
Get the transactions associated with this staking operation.
The array of transactions.
Private
loadloadTransactionsFromModel loads new unsigned transactions from the model into the transactions array. Note: For External Address model since tx signing and broadcast status happens by the end user and not our backend we need to be careful to not overwrite the transactions array with the response from the API. Ex: End user could have used stakingOperation.sign() method to sign the transactions, and we should not overwrite them with the response from the API. This however is ok to do so for the Wallet Address model since the transactions states are maintained by our backend. This method attempts to be safe for both address models, and only adds newly created unsigned transactions that are not already in the transactions array.
Reloads the StakingOperation model with the latest data from the server. If the StakingOperation object was created by an ExternalAddress then it will not have a wallet ID.
if the API request to get the StakingOperation fails.
if this function is called on a StakingOperation without a wallet ID.
Waits until the Staking Operation is completed or failed by polling its status at the given interval.
The options to configure the wait function.
The interval at which to poll, in seconds
The maximum amount of time to wait for the StakingOperation to complete, in seconds
The completed StakingOperation object.
If the StakingOperation takes longer than the given timeout.
Static
fetchGet the staking operation for the given ID.
The network ID.
The address ID.
The staking operation ID.
Optional
walletId: stringThe wallet ID of the staking operation.
The staking operation object.
If the wallet id is defined but empty.
A representation of a staking operation (stake, unstake, claim stake, etc.). It may have multiple steps with some being transactions to sign, and others to wait.