# Class: Clock
A representation of network time.
All members of Clock
start from 0 upon network boot.
# Table of contents
# Constructors
# Accessors
# Methods
# Constructors
# constructor
• new Clock(slot
, epochStartTimestamp
, epoch
, leaderScheduleEpoch
, unixTimestamp
)
# Parameters
Name | Type | Description |
---|---|---|
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. |
# Defined in
internal.d.ts:225 (opens new window)
# Accessors
# epoch
• get
epoch(): bigint
The current epoch.
# Returns
bigint
# Defined in
internal.d.ts:230 (opens new window)
• set
epoch(val
): void
# Parameters
Name | Type |
---|---|
val | bigint |
# Returns
void
# Defined in
internal.d.ts:231 (opens new window)
# epochStartTimestamp
• get
epochStartTimestamp(): bigint
The timestamp of the first Slot
in this Epoch
.
# Returns
bigint
# Defined in
internal.d.ts:233 (opens new window)
• set
epochStartTimestamp(val
): void
# Parameters
Name | Type |
---|---|
val | bigint |
# Returns
void
# Defined in
internal.d.ts:234 (opens new window)
# leaderScheduleEpoch
• get
leaderScheduleEpoch(): bigint
The future Epoch for which the leader schedule has most recently been calculated.
# Returns
bigint
# Defined in
internal.d.ts:236 (opens new window)
• set
leaderScheduleEpoch(val
): void
# Parameters
Name | Type |
---|---|
val | bigint |
# Returns
void
# Defined in
internal.d.ts:237 (opens new window)
# slot
• get
slot(): bigint
The current Slot.
# Returns
bigint
# Defined in
internal.d.ts:227 (opens new window)
• set
slot(val
): void
# Parameters
Name | Type |
---|---|
val | bigint |
# Returns
void
# Defined in
internal.d.ts:228 (opens new window)
# unixTimestamp
• get
unixTimestamp(): bigint
The approximate real world time of the current slot.
# Returns
bigint
# Defined in
internal.d.ts:239 (opens new window)
• set
unixTimestamp(val
): void
# Parameters
Name | Type |
---|---|
val | bigint |
# Returns
void
# Defined in
internal.d.ts:240 (opens new window)
# Methods
# toString
▸ toString(): string
# Returns
string