TimeLock
@iota/audit-trails API documentation
Class: TimeLock
Time-based lock used in the trail's LockingConfig.
Remarks
TimeLock.withUntilDestroyed is rejected by the audit-trail package when used as the trail-delete lock; pass it only for the write lock.
Properties
args
readonlyargs:any
Returns the lock argument for parameterized variants.
Returns
The numeric argument for UnlockAt/UnlockAtMs variants, or undefined
otherwise.
type
readonlytype:TimeLockType
Returns the lock variant.
Returns
The TimeLockType discriminant for this lock.
Methods
toJSON()
toJSON():
Object
- Return copy of self without private attributes.
Returns
Object
toString()
toString():
string
Return stringified version of self.
Returns
string
withInfinite()
staticwithInfinite():TimeLock
Creates a lock that never unlocks.
Returns
TimeLock
A lock that is always active.
withNone()
staticwithNone():TimeLock
Creates a disabled lock.
Returns
TimeLock
A lock that does not gate the protected operation.
withUnlockAt()
staticwithUnlockAt(time_sec):TimeLock
Creates a lock that unlocks at a Unix timestamp in seconds.
Parameters
time_sec
number
Returns
TimeLock
A lock that unlocks once the on-chain clock reaches timeSec.
withUnlockAtMs()
staticwithUnlockAtMs(time_ms):TimeLock
Creates a lock that unlocks at a Unix timestamp in milliseconds.
Parameters
time_ms
bigint
Returns
TimeLock
A lock that unlocks once the on-chain clock reaches timeMs.
withUntilDestroyed()
staticwithUntilDestroyed():TimeLock
Creates a lock that stays active until the protected object is destroyed.
Returns
TimeLock
A lock that remains active until the protected object is destroyed.