Reconcile a TRON unstake that also withdraws earlier matured funds
Submitting a new Stake 2.0 unstake can credit TRX from older unstakes that have already matured. A balance increase on that transaction can belong to a previous request.
Separate the new request from matured principal
Record the resource category and amount requested in UnfreezeBalanceV2Contract. Look up the confirmed transaction info for the same ID. The abbreviated example reports an automatic withdrawal of seven TRX in sun while a new unstake is being initiated.
{
"withdraw_expire_amount": 7000000
}
Match cash movements to their original stage
A new unstake of ten TRX and an automatic credit of seven should create a pending ten and a liquid credit of seven. Do not mark the new ten as withdrawn. Reconcile current pending entries and the network’s configured delay, then account for any network fee independently of the returned principal.