import * as bitcoin from 'bitcoinjs-lib'; import type { Secp256k1PrivateKeyBytes } from '../../cryptography'; import type { BitcoinAddress, Brand, TransactionHex } from '../../types'; import type { BitcoinUtxo } from './api'; export type BitcoinOutputScript = Brand; type BuildSweepTransactionParams = { accountId: string; fromAddress: BitcoinAddress; outputScript: BitcoinOutputScript; utxos: BitcoinUtxo[]; feeRateSatsPerVByte: number; privateKey: Secp256k1PrivateKeyBytes; network: bitcoin.Network; }; /** * Validates a Bitcoin destination address for the given network and returns its output script. * * Supports P2PKH, P2SH, P2WPKH, P2WSH, and P2TR (Taproot / bech32m) address types. * The output script is returned so callers can pass it directly to estimateSweepTransaction / * buildSweepTransaction without recomputing it. * * @returns The validated address and its compiled output script * @throws {InvalidDestinationAddressError} If the address is not valid for the network */ export declare function validateBitcoinDestinationAddress(destinationAddress: string, network: bitcoin.Network): { address: BitcoinAddress; outputScript: BitcoinOutputScript; }; /** * Calculates the fee and net send amount for a sweep transaction without broadcasting. * * @returns `amountToSend` (totalInputValue - fee) and `fee` in satoshis. * @throws {NoWithdrawableAssetsError} If the net amount is zero, negative, or below the * dust limit for the destination output type (Bitcoin nodes reject sub-dust outputs) */ export declare function estimateSweepTransaction({ accountId, outputScript, utxos, feeRateSatsPerVByte }: Pick): { amountToSend: bigint; fee: bigint; }; /** * Builds, signs, and serializes a P2WPKH sweep transaction. * * Spends all provided UTXOs into a single output at `destinationAddress` with no * change output. The transaction is signed with `privateKeyHex` using ECDSA. * * @returns Raw transaction hex ready for broadcast * @throws {NoWithdrawableAssetsError} If the fee exceeds total UTXO value */ export declare function buildSweepTransaction({ accountId, fromAddress, outputScript, utxos, feeRateSatsPerVByte, privateKey, network }: BuildSweepTransactionParams): TransactionHex; export {};