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
Name | Type |
---|---|
api | ApiPromise |
now | number |
currentBlock | bigint |
slotDuration | bigint |
Returns
Defined in
Properties
_api
• Private
_api: ApiPromise
Defined in
_currentBlock
• Private
_currentBlock: bigint
Defined in
_currentTime
• Private
_currentTime: number
Defined in
_slotDuration
• Private
_slotDuration: bigint
Defined in
Accessors
currentBlock
• get
currentBlock(): bigint
Returns
bigint
Defined in
currentTime
• get
currentTime(): number
Returns
number
Defined in
slotDuration
• get
slotDuration(): bigint
Returns
bigint
Defined in
Methods
atBlock
▸ atBlock(blockNumber
): Promise
<ChainTime
>
Parameters
Name | Type |
---|---|
blockNumber | bigint |
Returns
Promise
<ChainTime
>
Defined in
atDate
▸ atDate(date
): Promise
<ChainTime
>
Parameters
Name | Type |
---|---|
date | Date |
Returns
Promise
<ChainTime
>
Defined in
now
▸ now(api
): Promise
<ChainTime
>
Parameters
Name | Type |
---|---|
api | ApiPromise |
Returns
Promise
<ChainTime
>