From f59a373e11513a82e2511de7d97460f0249b0825 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 18 Jan 2025 15:06:21 -0800 Subject: [PATCH] Update typings. --- types.d.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/types.d.ts b/types.d.ts index f81da16..3fe38ad 100644 --- a/types.d.ts +++ b/types.d.ts @@ -15,7 +15,7 @@ declare const NanoPow: typeof NanoPowGl | typeof NanoPowGpu | null */ 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 } @@ -23,13 +23,14 @@ export declare class NanoPowGl { #private /** Compile */ static init (): Promise + 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 + static search (hash: string, options?: NanoPowOptions): Promise /** * Validates that a nonce satisfies Nano proof-of-work requirements. * @@ -37,7 +38,7 @@ export declare class NanoPowGl { * @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 + static validate (work: string, hash: string, options?: NanoPowOptions): Promise } /** @@ -52,15 +53,15 @@ export declare class NanoPowGpu { * 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 + static search (hash: string, options?: NanoPowOptions): Promise /** * 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 + static validate (work: string, hash: string, options?: NanoPowOptions): Promise } -- 2.34.1