import { Hex, RawSignature } from '@left-curve/types'; import { KeyPair } from './keypair.js'; /** * Recover the public key from a message hash and signature. * @param hash - The hash of the message that was signed. * @param signature - The signature to recover the public key from. * @param compressed - Whether to return the public key in compressed form. * @returns The public key that signed the message hash. */ declare function secp256k1RecoverPubKey(hash: Hex | Uint8Array, _signature_: Hex | Uint8Array | RawSignature, compressed?: boolean): Promise; /** * Compress or uncompress a secp256k1 public key. * @param pubKey - The public key to compress or uncompress. * @param compress - True to compress the public key, false to uncompress it. * @returns The compressed or uncompressed public key. */ declare function secp256k1CompressPubKey(pubKey: Uint8Array, compress: boolean): Uint8Array; /** * Verify a secp256k1 signature * @param messageHash - The hash of the message that was signed. * @param signature - The signature to verify. * @param publicKey - The public key to verify the signature with. * @returns True if the signature is valid, false otherwise. */ declare function secp256k1VerifySignature(messageHash: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): boolean; declare class Secp256k1 implements KeyPair { #private; /** * Generate a new secp256k1 key pair. * @returns A new secp256k1 key pair. */ static makeKeyPair(): Secp256k1; /** * Derive a secp256k1 key pair from a mnemonic. * @param mnemonic - The English mnemonic to derive the key pair from. * @param coinType - The BIP-44 coin type to derive the key pair for. * @returns A new secp256k1 key pair. */ static fromMnemonic(mnemonic: string, coinType?: number): Secp256k1; constructor(privateKey: Uint8Array); getPublicKey(compressed?: boolean): Uint8Array; get privateKey(): Uint8Array; /** * Sign a message hash with the private key. * @param messageHash - The hash of the message to sign. * @returns The signature of the message hash. */ createSignature(messageHash: Uint8Array, recovery?: boolean): Uint8Array; /** * Verify a signature of a message hash. * @param messageHash - The hash of the message that was signed. * @param signature - The signature to verify. * @returns True if the signature is valid, false otherwise. */ verifySignature(messageHash: Uint8Array, signature: Uint8Array): boolean; } export { Secp256k1, secp256k1CompressPubKey, secp256k1RecoverPubKey, secp256k1VerifySignature };