Home Reference Source Test
public class | source

Block

Static Method Summary

Static Public Methods
public static

Constructor Summary

Public Constructor
public

constructor(header: BlockHeader, interlink: BlockInterlink, body: BlockBody)

Member Summary

Public Members
public get
public get
public get
public get
public get
public get

height: number

public get
public get
public get

nBits: number

public get

nonce: number

public get
public get

serializedSize: number

public get
public get

timestamp: number

public get
public get
public get

version: number: *

Method Summary

Public Methods
public

equals(o: Block | *): boolean

public

async getNextInterlink(nextTarget: BigNumber, nextVersion: number): Promise<BlockInterlink>

public
public

isFull(): boolean

public

async isImmediateSuccessorOf(predecessor: Block): Promise<boolean>

public

async isInterlinkSuccessorOf(predecessor: Block): Promise<boolean>

public

isLight(): boolean

public

async isSuccessorOf(predecessor: Block): Promise<boolean>

public

pow(buf: SerialBuffer): Promise<Hash>

public
public
public
public
public

toString(): string

public

async verify(time: Time): Promise<boolean>

Static Public Methods

public static unserialize(buf: SerialBuffer): Block source

Params:

NameTypeAttributeDescription
buf SerialBuffer

Return:

Block

Public Constructors

public constructor(header: BlockHeader, interlink: BlockInterlink, body: BlockBody) source

Params:

NameTypeAttributeDescription
header BlockHeader
interlink BlockInterlink
body BlockBody
  • optional

Public Members

public get accountsHash: Hash source

public get body: BlockBody source

public get bodyHash: Hash source

public get difficulty: BigNumber source

public get header: BlockHeader source

public get height: number source

public get minerAddr: Address source

public get nBits: number source

public get nonce: number source

public get prevHash: Hash source

public get serializedSize: number source

public get target: BigNumber source

public get timestamp: number source

public get transactionCount: number source

public get transactions: Array<Transaction> source

public get version: number: * source

Return:

number

Public Methods

public equals(o: Block | *): boolean source

Params:

NameTypeAttributeDescription
o Block | *

Return:

boolean

Params:

NameTypeAttributeDescription
nextTarget BigNumber
nextVersion number
  • optional

Return:

Promise<BlockInterlink>

public hash(buf: SerialBuffer): Hash source

Params:

NameTypeAttributeDescription
buf SerialBuffer
  • optional

Return:

Hash

public isFull(): boolean source

Return:

boolean

public async isImmediateSuccessorOf(predecessor: Block): Promise<boolean> source

Params:

NameTypeAttributeDescription
predecessor Block

Return:

Promise<boolean>

public async isInterlinkSuccessorOf(predecessor: Block): Promise<boolean> source

Params:

NameTypeAttributeDescription
predecessor Block

Return:

Promise<boolean>

public isLight(): boolean source

Return:

boolean

public async isSuccessorOf(predecessor: Block): Promise<boolean> source

Params:

NameTypeAttributeDescription
predecessor Block

Return:

Promise<boolean>

public pow(buf: SerialBuffer): Promise<Hash> source

Params:

NameTypeAttributeDescription
buf SerialBuffer
  • optional

Return:

Promise<Hash>

public serialize(buf: SerialBuffer): SerialBuffer source

Params:

NameTypeAttributeDescription
buf SerialBuffer
  • optional

Return:

SerialBuffer

public shallowCopy(): Block source

Return:

Block

public toFull(body: BlockBody): Block source

Params:

NameTypeAttributeDescription
body BlockBody

Return:

Block

public toLight(): Block source

Return:

Block

public toString(): string source

Return:

string

public async verify(time: Time): Promise<boolean> source

Params:

NameTypeAttributeDescription
time Time

Return:

Promise<boolean>