The following is a typical UI for displaying Staking information:
...
2. If balance - available = staked
, then there are no unstaked and locked tokens.
...
Code Block |
---|
{ "lock_amount": 2000000000000, "remaining_lock_amount": 1000000000000, "time_stamp": "2020-03-11T18:30:56", "payouts_performed": 2, "can_vote": 1, "unlock_periods": [ { "duration": 86400, "amount": 1000000000000 }, { "duration": 172800, "amount": 500000000000 }, { "duration": 259200, "amount": 500000000000 } ] } |
It is important to note that get_locks
returns the state of the lock table. The lock table ONLY updates upon a vote or transfer transaction. So, the lock table values, such as remaining_lock_amount
may be inaccurate because they have not yet been accounted by the system. get_locks
does NOT do anything to validate these values.
4. Since it is possible that one or more unstaking unlock_periods
have passed (7 or more days has elapsed since unstaking, each period will need to be checked.
...
b. If the calculated unlock_day <= current_day
then this unstake period has already passed and those tokens are already unstaked and available to the user.
...