Skip to main content

Reference / Modules / node-api / ChainTime

Class: ChainTime

node-api.ChainTime

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ChainTime(api, now, currentBlock, slotDuration): ChainTime

Parameters

NameType
apiApiPromise
nownumber
currentBlockbigint
slotDurationbigint

Returns

ChainTime

Defined in

ChainTime.ts:11

Properties

_api

Private _api: ApiPromise

Defined in

ChainTime.ts:18


_currentBlock

Private _currentBlock: bigint

Defined in

ChainTime.ts:20


_currentTime

Private _currentTime: number

Defined in

ChainTime.ts:19


_slotDuration

Private _slotDuration: bigint

Defined in

ChainTime.ts:21

Accessors

currentBlock

get currentBlock(): bigint

Returns

bigint

Defined in

ChainTime.ts:27


currentTime

get currentTime(): number

Returns

number

Defined in

ChainTime.ts:23


slotDuration

get slotDuration(): bigint

Returns

bigint

Defined in

ChainTime.ts:31

Methods

atBlock

atBlock(blockNumber): Promise<ChainTime>

Parameters

NameType
blockNumberbigint

Returns

Promise<ChainTime>

Defined in

ChainTime.ts:42


atDate

atDate(date): Promise<ChainTime>

Parameters

NameType
dateDate

Returns

Promise<ChainTime>

Defined in

ChainTime.ts:35


now

now(api): Promise<ChainTime>

Parameters

NameType
apiApiPromise

Returns

Promise<ChainTime>

Defined in

ChainTime.ts:5