Timelock
It locks any object with the store ability for a specific amount of time. We do not provide a function to read the data inside the {Timelock} to prevent capabilities from being used.
Structs
Timelock
unlock_time - The unlock time in milliseconds.
data - Any object with the store ability.
Interface
unlock_time
Returns the unlock time in milliseconds.
@param self: A {Timelock}
@return u64. The
self.unlock_time
.
lock
Locks the data
for unlock_time
milliseconds.
@param data: An object with the store ability.
@param c: The shared
sui::clock::Clock
object.@param unlock_time: The lock period in milliseconds.
@return {Timelock}.
Aborts
unlock_time
is in the past.
unlock
Unlocks a {Timelock} and returns the locked resource T
.
@param self: A {Timelock}
@param c: The shared
sui::clock::Clock
object.@return
T
. An object with the store ability.
Aborts
unlock_time
has not passed.
Last updated