Class: Block

Block(hexDataopt, optsopt)

new Block(hexDataopt, optsopt)

Initializes a new CryptoNote Block object
Parameters:
Name Type Attributes Description
hexData string | Block.BlockConfig <optional>
the hexadecimal representation of an existing block or a configuration object
opts Block.BlockConfig <optional>
a configuration object
Source:

Members

activateParentBlockVersion :number

The block major version at which Parent Blocks were enabled
Type:
  • number
Default Value:
  • 2
Source:

(readonly) baseTransactionBranch :string

The block base transaction branch
Type:
  • string
Source:

blob :string

The hexadecimal representation of the block
Type:
  • string
Source:

(readonly) cryptoType :string

Returns the underlying cryptography module used
Type:
  • string
Source:

extraNonce :number

The block extra nonce
Type:
  • number
Source:

(readonly) hash :string

The block hash
Type:
  • string
Source:

(readonly) hashingBlob :string

The hexadecimal representation of the block used for hashing (PoW)
Type:
  • string
Source:

(readonly) height :number|null

The block height
Type:
  • number | null
Source:

(readonly) longHash :string

The block PoW hash
Type:
  • string
Source:

majorVersion :number

The block major version
Type:
  • number
Default Value:
  • 0
Source:

(readonly) meetsDiff :boolean

Whether the block meets the defined difficulty
Type:
  • boolean
Source:

(readonly) merkleRoot :string

The block merkle root
Type:
  • string
Source:

minerTransaction :Transaction

The previous block miner transaction
Type:
Source:

minorVersion :number

The block minor version
Type:
  • number
Default Value:
  • 0
Source:

nonce :number

The block nonce
Type:
  • number
Default Value:
  • 0
Source:

parentBlock :Object

The block parent block structure
Type:
  • Object
Properties:
Name Type Default Description
majorVersion number 0 The major version of the parent block
minorVersion number 0 The minor version of the parent block
previousBlockHash string 0000000000000000000000000000000000000000000000000000000000000000 The parent block previous block hash
transactionCount number 0 The number of transactions in the parent block
baseTransactionBranch Array.<string> The parent block base transaction branch hash(es)
minerTransaction Transaction The parent block miner transaction
blockchainBranch Array.<string> The parent block blockchain branch hash(es)
Source:

previousBlockHash :string

The previous block hash
Type:
  • string
Default Value:
  • 0000000000000000000000000000000000000000000000000000000000000000
Source:

(readonly) size :number

The size of the block in bytes
Type:
  • number
Source:

targetDifficulty :number

The target difficulty of the block
Type:
  • number
Default Value:
  • 1
Source:

timestamp :number

The block timestamp
Type:
  • number
Default Value:
  • 0
Source:

transactions :Array.<string>

The transaction hashes in the block
Type:
  • Array.<string>
Source:

(readonly) transactionTreeHashData :string

The block transaction tree hash
Type:
  • string
Source:

Methods

hashMeetsDifficulty(hash, difficulty) → {boolean}

Whether the PoW hash meets the supplied difficulty
Parameters:
Name Type Description
hash string the PoW hash
difficulty number the difficulty to meet (or exceed)
Source:
Returns:
whether the hash meets or exceeds the supplied difficulty
Type
boolean

Type Definitions

BlockConfig

An object containing configuration options
Type:
  • Object
Properties:
Name Type Attributes Default Description
activateParentBlockVersion number <optional>
2 The block major version at which Parent Blocks were enabled
Source: