/** * @license * @preserve * * KeeeX SAS Public code * https://keeex.me * Copyright 2013-2023 KeeeX All Rights Reserved. * * These computer program listings and specifications, herein, * are and remain the property of KeeeX SAS. The intellectual * and technical concepts herein are proprietary to KeeeX SAS * and may be covered by EU and foreign patents, * patents in process, trade secrets and copyright law. * * These listings are published as a way to provide third party * with the ability to process KeeeX data. * As such, support for public inquiries is limited. * They are provided "as-is", without warrany of any kind. * * They shall not be reproduced or copied or used in whole or * in part as the basis for manufacture or sale of items unless * prior written permission is obtained from KeeeX SAS. * * For a license agreement, please contact: * * */ import * as recovery from "../utils/recovery.js"; import { PassphraseMethod } from "./consts.js"; import { EcSig } from "./ecsig.js"; /** Wrapper around a private key */ export declare class Secp256k1Keypair { #private; private constructor(); get privateKeyBytes(): Uint8Array | undefined; get canSign(): boolean; getPublicKeyBytes: (compressed?: boolean) => Uint8Array; get recoveryInfo(): recovery.UserGenerationRecoveryInfo | undefined; /** * Sign a message. * * @param fieldOrder - Order of the field for the ordered signature bytes. Different between BTC * and ETH. * * @returns * The ordered signature bytes. */ sign: (message: Uint8Array) => EcSig; /** * Verify a signature against a message. * * @param fieldOrder - Order of the signature fields. Different between BTC and ETH. */ verify: (message: Uint8Array, ecSig: EcSig) => boolean; deriveSharedSecret: (otherKeypair: Secp256k1Keypair) => Uint8Array; /** * Return the key used in a signature. * * @param fieldOrder - Order of the signature fields. Different between BTC and ETH. */ static readonly recoverPublicKey: (message: Uint8Array, ecSig: EcSig) => Secp256k1Keypair; /** Create a full instance from private key bytes */ static readonly fromPrivateKeyBytes: (privateKeyBytes: Uint8Array, isCompressed: boolean) => Secp256k1Keypair; static readonly fromPassphrase: (passphrase: string, version: PassphraseMethod) => Promise; static readonly fromPublicKey: (publicKeyBytes: Uint8Array) => Secp256k1Keypair; static readonly randomKeypair: () => Promise; }