Constructor
new Block(blockNumber, previousHash, transactions)
Create a block
Parameters:
Name | Type | Description |
---|---|---|
blockNumber |
number | block number |
previousHash |
string | hex string of hash of previous block |
transactions |
Array.<Transaction> | array of transactions |
- Source:
Members
hash
Sha3 hash of the hex string representing transactions in this block
- Source:
Methods
(static) fromJSON(json)
Create a block from json
Parameters:
Name | Type | Description |
---|---|---|
json |
Object | json string from toJSON() |
- Source:
(static) splitTxData(txData)
Split transaction data into txBytes, sig1, sig2
Parameters:
Name | Type | Description |
---|---|---|
txData |
string | hex string of data to split into txBytes, sig1, sig2 |
- Source:
getTransactions()
Get Transaction in block
- Source:
printBlock()
Returns a simplified json object representing a block
- Source:
toJSON()
Convert a block to JSON
- Source:
toString()
Convert block to hex string of transactions without the prefix.
- Source: