nanocurrency
Version:
A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks.
19 lines (18 loc) • 705 B
TypeScript
/** Compute work parameters. */
export interface ComputeWorkParams {
/** The current worker index, starting at 0 */
workerIndex?: number;
/** The count of worker */
workerCount?: number;
/** The work threshold, in hex format. Defaults to `ffffffc000000000` */
workThreshold?: string;
}
/**
* Find a work value that meets the difficulty for the given hash.
* Require WebAssembly support.
*
* @param blockHash - The block hash to find a work for
* @param params - Parameters
* @returns Work, in hexadecimal format, or null if no work has been found (very unlikely)
*/
export declare function computeWork(blockHash: string, params?: ComputeWorkParams): Promise<string | null>;