Block

Interface
Attributes of a Block persisted to the blockchain.
export interface Block { 
  readonly hash: Hash256; 
  readonly version: Integer; 
  readonly previousHash: Hash256; 
  readonly index: Integer; 
  readonly merkleRoot: Hash256; 
  readonly time: Integer; 
  readonly nextConsensus: Address; 
  readonly transactionsLength: Integer; 
} 

Properties

hash
Block hash.
version
NEO blockchain version.
previousHash
Previous Block hash.
index
Block index.
merkleRoot
Root of the Transaction hash Merkle Tree.
time
Block time persisted.
nextConsensus
Next consensus address.
transactionsLength
The number of Transactions contained in the Block.

Static Methods

for

Accepts either the Hash256 or the index of the Block.
(hashOrIndex: Hash256 | Integer) => Block 

Example

const genesisBlock = Block.for(0); 

Example

const blockHash = Hash256.from('0xd6572a459b95d9136b7a713c5485ca709f9efa4f08f1c25dd792672d2bd75bfb'); 
const arbitraryBlock = Block.for(blockHash); 
  • @neo-one/client
  • @neo-one/smart-contract
DOCS
InstallationMain ConceptsAdvanced GuidesAPI ReferenceContributing
CHANNELS
GitHubStack OverflowDiscord ChatTwitter
COPYRIGHT © 2021 NEO•ONE