Tip: 541
Title: Support canceling unstaking in Stake 2.0
Author: CooperDepp <[email protected]>
Discussions-to: https://github.com/tronprotocol/tips/issues/541
Status: Final
Type: Standards Track
Category: Core
Created: 2023-05-05
Add an API in Stake 2.0 to allow users to cancel the unstaking transactions in the waiting period.
To be consistent with TVM instructions in Stake 2.0, it is proposed to add an API to support canceling unstaking in Stake 2.0, which means that users can use this API to cancel unstaking in waiting period time, make the unstaking TRX restaked, and meanwhile help users withdraw the TRX expired waiting period to balance.
Stake 2.0 has been launched on TRON mainnet, one of the changes is that there is a waiting period of 14 days after unstaking. As said in this issue, if users misoperate the unstaking transaction, or they change their mind during the waiting period and want to restake the TRX for earnings, for now, they can do nothing but wait for 14 days. This is detrimental to the user's benefit and the staking rate of TRX on the chain.
Meanwhile, as Stake 2.0 has already supported TVM instructions to cancel the unstakings in the smart contract, I think it is reasonable to add an API in Stake 2.0 to cancel the unstaking transactions.
Add wallet/cancelallunfreezev2
API, the user can call this API to cancel all the ongoing unstaking transactions in the waiting period.
Params:
owner_address
- address of transaction initiator, data type is string
visible
- whether the address is in base58 format, data type is bool
Returns: unsigned transaction, data type is json string
Example:
curl -X POST http://127.0.0.1:8092/wallet/cancelallunfreezev2 -d \
'{
"owner_address":"TVrukxw11XrfnXuqDgbyQEgogXr1vcoWcq",
"visible":true
}'
It will not influence the existed staking and unstaking related transactions.