BlockUtils
Static Method Summary
Static Public Methods | ||
public static |
compactToDifficulty(compact: number): BigNumber |
|
public static |
compactToTarget(compact: number): BigNumber |
|
public static |
difficultyToCompact(difficulty: BigNumber): number |
|
public static |
difficultyToTarget(difficulty: BigNumber): BigNumber |
|
public static |
getHashDepth(hash: Hash): number |
|
public static |
getNextTarget(headBlock: BlockHeader, tailBlock: BlockHeader, deltaTotalDifficulty: BigNumber): BigNumber |
|
public static |
getTargetDepth(target: BigNumber): number |
|
public static |
getTargetHeight(target: BigNumber): number |
|
public static |
hashToTarget(hash: Hash): BigNumber |
|
public static |
isProofOfWork(hash: Hash, target: BigNumber): boolean |
|
public static |
isValidCompact(compact: number): boolean |
|
public static |
isValidTarget(target: BigNumber): boolean |
|
public static |
realDifficulty(hash: Hash): BigNumber |
|
public static |
targetToCompact(target: BigNumber): number |
|
public static |
targetToDifficulty(target: BigNumber): BigNumber |
Static Public Methods
public static compactToDifficulty(compact: number): BigNumber source
Params:
Name | Type | Attribute | Description |
compact | number |
public static compactToTarget(compact: number): BigNumber source
Params:
Name | Type | Attribute | Description |
compact | number |
public static difficultyToCompact(difficulty: BigNumber): number source
Params:
Name | Type | Attribute | Description |
difficulty | BigNumber |
Return:
number |
public static difficultyToTarget(difficulty: BigNumber): BigNumber source
Params:
Name | Type | Attribute | Description |
difficulty | BigNumber |
public static getHashDepth(hash: Hash): number source
Params:
Name | Type | Attribute | Description |
hash | Hash |
Return:
number |
public static getNextTarget(headBlock: BlockHeader, tailBlock: BlockHeader, deltaTotalDifficulty: BigNumber): BigNumber source
Params:
Name | Type | Attribute | Description |
headBlock | BlockHeader | ||
tailBlock | BlockHeader | ||
deltaTotalDifficulty | BigNumber |
public static getTargetDepth(target: BigNumber): number source
Params:
Name | Type | Attribute | Description |
target | BigNumber |
Return:
number |
public static getTargetHeight(target: BigNumber): number source
Params:
Name | Type | Attribute | Description |
target | BigNumber |
Return:
number |
public static hashToTarget(hash: Hash): BigNumber source
Params:
Name | Type | Attribute | Description |
hash | Hash |
public static isValidCompact(compact: number): boolean source
Params:
Name | Type | Attribute | Description |
compact | number |
Return:
boolean |
public static isValidTarget(target: BigNumber): boolean source
Params:
Name | Type | Attribute | Description |
target | BigNumber |
|
Return:
boolean |
public static realDifficulty(hash: Hash): BigNumber source
Params:
Name | Type | Attribute | Description |
hash | Hash |