From 3650acce33b06a6ce4bba03f50554cc8c2c71925 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 20 Jun 2026 22:19:17 -0700 Subject: [PATCH] Adjust main exports. Revert bytes replacement of bigint helpers. --- src/index.ts | 14 +++++++------- src/utils/index.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9a9e8cd..695740b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,9 +6,11 @@ import { generate, validate } from './lib' declare global { interface Window { - NanoPow: typeof NanoPow + NanoPow: { + work_generate: typeof work_generate + work_validate: typeof work_validate + } } - type Bytes = Uint8Array } /** @@ -62,7 +64,7 @@ export type WorkValidateResponse = { * @param {number} [options.effort=0x4] - GPU load when generating work. Larger values are not necessarily better since they can quickly overwhelm the GPU. Default: 0x4 * @param {bigint} [options.difficulty=0xfffffff800000000] - Minimum value result of `BLAKE2b(nonce||blockhash)`. Default: 0xFFFFFFF800000000 */ -async function work_generate (hash: bigint | string, options: NanoPowOptions): Promise { +export async function work_generate (hash: bigint | string, options: NanoPowOptions): Promise { return generate(hash, options) } @@ -75,10 +77,8 @@ async function work_generate (hash: bigint | string, options: NanoPowOptions): P * @param {boolean} [options.debug=false] - Enables additional debug logging to the console. Default: false * @param {bigint} [options.difficulty=0xfffffff800000000] - Minimum value result of `BLAKE2b(nonce||blockhash)`. Default: 0xFFFFFFF800000000 */ -async function work_validate (work: bigint | string, hash: bigint | string, options: NanoPowOptions): Promise { +export async function work_validate (work: bigint | string, hash: bigint | string, options: NanoPowOptions): Promise { return validate(work, hash, options) } -const NanoPow = { work_generate, work_validate } - -export { NanoPow as default, NanoPow, work_generate, work_validate } +export default { work_generate, work_validate } diff --git a/src/utils/index.ts b/src/utils/index.ts index 2430a06..dcf6726 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -2,7 +2,7 @@ //! SPDX-License-Identifier: GPL-3.0-or-later export * from './api-support' -export * from './bytes' +export * from './bigint' export * from './cache' export * from './logger' export * from './queue' -- 2.52.0