import { ECPairAPI, ECPairInterface } from 'ecpair'; export { ECPairInterface } from 'ecpair'; import { AddressType, NetworkType } from '@unisat/wallet-types'; import * as bitcoin from 'bitcoinjs-lib'; export { bitcoin }; declare enum EccType { tiny = "tiny", bitcoinlab = "bitcoinlab" } declare class ECCManager { eccType: EccType; private tinyEcc; private tinyEccPair; private bitcoinlabEcc; private bitcoinlabEccPair; constructor(); setEccType(eccType: EccType): void; get ecc(): any; get eccPair(): ECPairAPI; } declare const eccManager: ECCManager; /** * Convert public key to bitcoin payment object. */ declare function publicKeyToPayment(publicKey: string, type: AddressType, networkType: NetworkType): bitcoin.payments.Payment | null; /** * Convert public key to bitcoin address. */ declare function publicKeyToAddress(publicKey: string, type: AddressType, networkType: NetworkType): string; /** * Convert public key to bitcoin scriptPk. */ declare function publicKeyToScriptPk(publicKey: string, type: AddressType, networkType: NetworkType): string; declare function decodeAddress(address: string): { networkType: NetworkType; addressType: AddressType; dust: number; }; /** * Get address type. */ declare function getAddressType(address: string, networkType?: NetworkType): AddressType; /** * Convert scriptPk to address. */ declare function scriptPkToAddress(scriptPk: string | Buffer, networkType?: NetworkType): string; declare function addressToScriptPk(address: string, networkType: NetworkType): Buffer; declare function isValidAddress(address: string, networkType: NetworkType): boolean; /** * Convert network type to bitcoinjs-lib network. */ declare function toPsbtNetwork(networkType: NetworkType): bitcoin.networks.Network; /** * Convert bitcoinjs-lib network to network type. */ declare function toNetworkType(network: bitcoin.Network): NetworkType; declare const toXOnly: (pubKey: Buffer) => Buffer; /** * Transform raw private key to taproot address private key */ declare function tweakSigner(signer: bitcoin.Signer, opts?: any): bitcoin.Signer; /** * ECDSA signature validator */ declare const validator: (pubkey: Buffer, msghash: Buffer, signature: Buffer) => boolean; /** * Schnorr signature validator */ declare const schnorrValidator: (pubkey: Buffer, msghash: Buffer, signature: Buffer) => boolean; declare function genPsbtOfBIP322Simple({ message, address, networkType, }: { message: string; address: string; networkType: NetworkType; }): bitcoin.Psbt; declare function getSignatureFromPsbtOfBIP322Simple(psbt: bitcoin.Psbt): string; declare function verifyMessageOfBIP322Simple(address: string, msg: string, signature: string, networkType?: NetworkType): boolean; declare function signMessageOfDeterministicECDSA(ecpair: ECPairInterface, message: string): string; declare function signMessageOfECDSA(privateKey: ECPairInterface, text: string): string; declare function verifyMessageOfECDSA(publicKey: string, text: string, sig: string): boolean; declare const UTXO_DUST = 546; export { UTXO_DUST, addressToScriptPk, decodeAddress, eccManager, genPsbtOfBIP322Simple, getAddressType, getSignatureFromPsbtOfBIP322Simple, isValidAddress, publicKeyToAddress, publicKeyToPayment, publicKeyToScriptPk, schnorrValidator, scriptPkToAddress, signMessageOfDeterministicECDSA, signMessageOfECDSA, toNetworkType, toPsbtNetwork, toXOnly, tweakSigner, validator, verifyMessageOfBIP322Simple, verifyMessageOfECDSA };