Skip to main content

TimeLock

@iota/notarization API documentation


Class: TimeLock

Represents a time lock configuration.

It allows the creation and inspection of time lock configurations for notarization objects.

Properties

type

readonly type: TimeLockType

Retrieves the type of the time lock.

Returns

The TimeLockType representing the type of the time lock.


args

readonly args: any

Retrieves the arguments associated with the time lock.

Returns

An any value containing the arguments for the time lock:

  • For UnlockAt, the timestamp is returned.
  • For other types, undefined is returned.

Methods

toJSON()

toJSON(): Object

  • Return copy of self without private attributes.

Returns

Object


toString()

toString(): string

Return stringified version of self.

Returns

string


withUnlockAt()

static withUnlockAt(time): TimeLock

Creates a time lock that unlocks at a specific timestamp.

Arguments

  • time - The timestamp in seconds since the Unix epoch at which the object will unlock.

Returns

A new TimeLock instance configured to unlock at the specified timestamp.

Parameters

time

number

Returns

TimeLock


withUntilDestroyed()

static withUntilDestroyed(): TimeLock

Creates a time lock that remains locked until the object is destroyed.

Returns

A new TimeLock instance configured to remain locked until destruction.

Returns

TimeLock


withNone()

static withNone(): TimeLock

Creates a time lock with no restrictions.

Returns

A new TimeLock instance with no time lock applied.

Returns

TimeLock