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 primaryIndex: Integer; 
  readonly merkleRoot: Hash256; 
  readonly time: Integer; 
  readonly nonce: Integer; 
  readonly nextConsensus: Address; 
  readonly transactionsLength: Integer; 
} 

Properties

hash
Block hash.
version
NEO blockchain version.
previousHash
Previous Block hash.
index
Block index.
primaryIndex
Block primary index of the consensus node that generated this block.
merkleRoot
Root of the Transaction hash Merkle Tree.
time
Block time persisted.
nonce
The nonce of the Block.
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 ChatTwitterYouTube
COPYRIGHT © 2021 NEO•ONE