Skip to main content

Class: EvmBlockDate

moralis-monorepo / @moralisweb3/common-evm-utils / EvmBlockDate

Class: EvmBlockDate

@moralisweb3/common-evm-utils.EvmBlockDate

Table of contents

Methods

Accessors

Methods

create

Static create(data): EvmBlockDate

Create a new instance of EvmBlockDate.

Parameters

NameTypeDescription
dataEvmBlockDateishthe EvmBlockDateish type.

Returns

EvmBlockDate

Accessors

block

get block(): number

Description

The block number.

Example

9193266

Returns

number


blockTimestamp

get blockTimestamp(): undefined | string

Description

The timestamp of the block

Example

2022-01-03T22:59:39.000Z

Returns

undefined | string


block_hash

get block_hash(): undefined | string

Deprecated

Use hash instead.

Returns

undefined | string


block_timestamp

get block_timestamp(): undefined | string

Deprecated

Use blockTimestamp instead.

Returns

undefined | string


date

get date(): Date

Description

The date of the block.

Example

2020-01-01T00:00:00+00:00

Returns

Date


hash

get hash(): undefined | string

Description

The block hash.

Example

0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171

Returns

undefined | string


parentHash

get parentHash(): undefined | string

Description

The block hash of the parent block.

Example

0x011d1fc45839de975cc55d758943f9f1d204f80a90eb631f3bf064b80d53e045

Returns

undefined | string


parent_hash

get parent_hash(): undefined | string

Deprecated

Use parentHash instead.

Returns

undefined | string


timestamp

get timestamp(): number

Description

The timestamp of the block

Example

1577836811

Returns

number