import type * as Engine from '../core/Engine.js'; import * as Errors from '../core/Errors.js'; import * as internal from './internal/instantiate.js'; export * from '../core/Secp256k1.js'; export { MemoryError } from './internal/instantiate.js'; /** * Compiles WASM implementations of deterministic * [`Secp256k1`](/api/Secp256k1) primitives, without installing them. * * Random key generation remains on Ox's host-backed default implementation. * * @example * ```ts twoslash * // @noErrors * import { Engine } from 'ox' * import { Secp256k1 } from 'ox/wasm' * * await Engine.install({ Secp256k1: Secp256k1.engine() }) * * Secp256k1.getPublicKey({ privateKey: '0x...' }) * ``` * * @returns The WASM implementation of the deterministic `Secp256k1` primitives. */ export declare function engine(): Promise; export declare namespace engine { /** Every `Secp256k1` primitive this module implements. */ type ReturnType = { [key in 'getPublicKey' | 'getSharedSecret' | 'recoverPublicKey' | 'sign' | 'verify']-?: NonNullable; }; type ErrorType = InvalidInputError | internal.MemoryError | Errors.GlobalErrorType; } /** * Thrown when libsecp256k1 rejects a key or recovered signature. * * @example * ```ts twoslash * import { Secp256k1 } from 'ox/wasm' * * try { * const engine = await Secp256k1.engine() * engine.getPublicKey(new Uint8Array(32)) * } catch (error) { * if (error instanceof Secp256k1.InvalidInputError) * console.error(error.message) * } * ``` */ export declare class InvalidInputError extends Errors.BaseError { readonly name = "Secp256k1.InvalidInputError"; constructor({ operation }: { operation: string; }); } //# sourceMappingURL=Secp256k1.d.ts.map