*/
export type NanoPowOptions = {
debug?: boolean
- effort?: 0x1 | 0x2 | 0x3 | 0x4 | 0x5 | 0x6 | 0x7 | 0x8 | 0x9 | 0xa | 0xb | 0xc | 0xd | 0xe | 0xf | 0x10
+ effort?: number
threshold?: number
}
#private
/** Compile */
static init (): Promise<void>
+ static reset (): void
/**
* Finds a nonce that satisfies the Nano proof-of-work requirements.
*
* @param {string} hash - Hexadecimal hash of previous block, or public key for new accounts
* @param {number} [threshold=0xfffffff8] - Difficulty of proof-of-work calculation
*/
- static search (hash: string, threshold?: number): Promise<string>
+ static search (hash: string, options?: NanoPowOptions): Promise<string>
/**
* Validates that a nonce satisfies Nano proof-of-work requirements.
*
* @param {string} hash - Hexadecimal hash of previous block, or public key for new accounts
* @param {number} [threshold=0xfffffff8] - Difficulty of proof-of-work calculation
*/
- static validate (work: string, hash: string, threshold?: number): Promise<boolean>
+ static validate (work: string, hash: string, options?: NanoPowOptions): Promise<boolean>
}
/**
* Finds a nonce that satisfies the Nano proof-of-work requirements.
*
* @param {string} hash - Hexadecimal hash of previous block, or public key for new accounts
- * @param {number} [threshold=0xfffffff8] - Difficulty of proof-of-work calculation
+ * @param {NanoPowOptions} options - Used to configure search execution
*/
- static search (hash: string, threshold?: number): Promise<string>
+ static search (hash: string, options?: NanoPowOptions): Promise<string>
/**
* Validates that a nonce satisfies Nano proof-of-work requirements.
*
* @param {string} work - Hexadecimal proof-of-work value to validate
* @param {string} hash - Hexadecimal hash of previous block, or public key for new accounts
- * @param {number} [threshold=0xfffffff8] - Difficulty of proof-of-work calculation
+ * @param {NanoPowOptions} options - Options used to configure search execution
*/
- static validate (work: string, hash: string, threshold?: number): Promise<boolean>
+ static validate (work: string, hash: string, options?: NanoPowOptions): Promise<boolean>
}