Skip to content

API Reference / Clock

Class: Clock ​

Defined in: internal.d.ts:23

A representation of network time.

All members of Clock start from 0 upon network boot.

Constructors ​

Constructor ​

new Clock(slot, epochStartTimestamp, epoch, leaderScheduleEpoch, unixTimestamp): Clock

Defined in: internal.d.ts:31

Parameters ​

slot ​

bigint

The current Slot.

epochStartTimestamp ​

bigint

The timestamp of the first Slot in this Epoch.

epoch ​

bigint

The current epoch.

leaderScheduleEpoch ​

bigint

The future Epoch for which the leader schedule has most recently been calculated.

unixTimestamp ​

bigint

The approximate real world time of the current slot.

Returns ​

Clock

Accessors ​

epoch ​

Get Signature ​

get epoch(): bigint

Defined in: internal.d.ts:36

The current epoch.

Returns ​

bigint

Set Signature ​

set epoch(val): void

Defined in: internal.d.ts:37

Parameters ​
val ​

bigint

Returns ​

void


epochStartTimestamp ​

Get Signature ​

get epochStartTimestamp(): bigint

Defined in: internal.d.ts:39

The timestamp of the first Slot in this Epoch.

Returns ​

bigint

Set Signature ​

set epochStartTimestamp(val): void

Defined in: internal.d.ts:40

Parameters ​
val ​

bigint

Returns ​

void


leaderScheduleEpoch ​

Get Signature ​

get leaderScheduleEpoch(): bigint

Defined in: internal.d.ts:42

The future Epoch for which the leader schedule has most recently been calculated.

Returns ​

bigint

Set Signature ​

set leaderScheduleEpoch(val): void

Defined in: internal.d.ts:43

Parameters ​
val ​

bigint

Returns ​

void


slot ​

Get Signature ​

get slot(): bigint

Defined in: internal.d.ts:33

The current Slot.

Returns ​

bigint

Set Signature ​

set slot(val): void

Defined in: internal.d.ts:34

Parameters ​
val ​

bigint

Returns ​

void


unixTimestamp ​

Get Signature ​

get unixTimestamp(): bigint

Defined in: internal.d.ts:45

The approximate real world time of the current slot.

Returns ​

bigint

Set Signature ​

set unixTimestamp(val): void

Defined in: internal.d.ts:46

Parameters ​
val ​

bigint

Returns ​

void

Methods ​

toString() ​

toString(): string

Defined in: internal.d.ts:47

Returns ​

string