import * as btc from '@scure/btc-signer'; import { TransactionInputUpdate, TransactionOutput } from '@scure/btc-signer/psbt'; import * as P from 'micro-packed'; import { UtxoWithTx } from './api'; import { BitcoinNetwork } from './constants'; export declare function stacksAddressBytes(address: string): Uint8Array; export declare function paymentInfo({ tx, feeRate, utxos, utxoToSpendable, }: { tx: btc.Transaction; feeRate: number; utxos: UtxoWithTx[]; utxoToSpendable: Partial; }): Promise<{ inputs: import("@scure/btc-signer/psbt").ExtendType[]; outputs: P.StructInput<{ amount: any; script: any; }>[]; witnesses: P.Option; lockTime: number; }>>, readonly [], readonly [0, 2], false]; readonly witnessUtxo: readonly [1, false, P.CoderType>, readonly [], readonly [0, 2], false]; readonly partialSig: readonly [2, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly sighashType: readonly [3, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly redeemScript: readonly [4, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly witnessScript: readonly [5, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly bip32Derivation: readonly [6, P.CoderType, P.CoderType>, readonly [], readonly [0, 2], false]; readonly finalScriptSig: readonly [7, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly finalScriptWitness: readonly [8, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly porCommitment: readonly [9, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly ripemd160: readonly [10, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly sha256: readonly [11, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly hash160: readonly [12, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly hash256: readonly [13, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly txid: readonly [14, false, P.CoderType, readonly [2], readonly [2], true]; readonly index: readonly [15, false, P.CoderType, readonly [2], readonly [2], true]; readonly sequence: readonly [16, false, P.CoderType, readonly [], readonly [2], true]; readonly requiredTimeLocktime: readonly [17, false, P.CoderType, readonly [], readonly [2], false]; readonly requiredHeightLocktime: readonly [18, false, P.CoderType, readonly [], readonly [2], false]; readonly tapKeySig: readonly [19, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapScriptSig: readonly [20, P.CoderType>, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapLeafScript: readonly [21, P.CoderType>, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapBip32Derivation: readonly [22, P.CoderType, P.CoderType; }>>, readonly [], readonly [0, 2], false]; readonly tapInternalKey: readonly [23, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapMerkleRoot: readonly [24, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly proprietary: readonly [252, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; }>, { nonWitnessUtxo?: string | Uint8Array | undefined; txid?: string | undefined; }>[]; totalSats: bigint; changeSats: bigint; }>; export declare function txBytes(inputs: TransactionInputUpdate[], outputs: TransactionOutput[]): number; export declare function inputBytes(input: TransactionInputUpdate): number; export declare function outputBytes(output: TransactionOutput): number; export declare function dustMinimum(inputVsize: number, feeRate: number): number; export type Spendable = { input: TransactionInputUpdate; vsize?: number; }; export type SpendableByScriptTypes = { [Property in 'unknown' | 'sh' | 'wpkh' | 'wsh' | 'pk' | 'pkh' | 'ms' | 'tr' | 'tr_ns' | 'tr_ms']: (opts: UtxoToSpendableOpts) => Spendable | Promise; }; export declare const DEFAULT_UTXO_TO_SPENDABLE: Partial; interface UtxoToSpendableOpts { tx: btc.Transaction; txHex: string; utxo: UtxoWithTx; output: TransactionOutput; spendScript: ReturnType; } export declare function wpkhUtxoToSpendable(opts: UtxoToSpendableOpts): { input: import("@scure/btc-signer/psbt").ExtendType[]; outputs: P.StructInput<{ amount: any; script: any; }>[]; witnesses: P.Option; lockTime: number; }>>, readonly [], readonly [0, 2], false]; readonly witnessUtxo: readonly [1, false, P.CoderType>, readonly [], readonly [0, 2], false]; readonly partialSig: readonly [2, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly sighashType: readonly [3, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly redeemScript: readonly [4, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly witnessScript: readonly [5, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly bip32Derivation: readonly [6, P.CoderType, P.CoderType>, readonly [], readonly [0, 2], false]; readonly finalScriptSig: readonly [7, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly finalScriptWitness: readonly [8, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly porCommitment: readonly [9, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly ripemd160: readonly [10, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly sha256: readonly [11, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly hash160: readonly [12, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly hash256: readonly [13, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; readonly txid: readonly [14, false, P.CoderType, readonly [2], readonly [2], true]; readonly index: readonly [15, false, P.CoderType, readonly [2], readonly [2], true]; readonly sequence: readonly [16, false, P.CoderType, readonly [], readonly [2], true]; readonly requiredTimeLocktime: readonly [17, false, P.CoderType, readonly [], readonly [2], false]; readonly requiredHeightLocktime: readonly [18, false, P.CoderType, readonly [], readonly [2], false]; readonly tapKeySig: readonly [19, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapScriptSig: readonly [20, P.CoderType>, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapLeafScript: readonly [21, P.CoderType>, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapBip32Derivation: readonly [22, P.CoderType, P.CoderType; }>>, readonly [], readonly [0, 2], false]; readonly tapInternalKey: readonly [23, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly tapMerkleRoot: readonly [24, false, P.CoderType, readonly [], readonly [0, 2], false]; readonly proprietary: readonly [252, P.CoderType, P.CoderType, readonly [], readonly [0, 2], false]; }>, { nonWitnessUtxo?: string | Uint8Array | undefined; txid?: string | undefined; }>; vsize: number; }; export declare function shUtxoToSpendable(net: BitcoinNetwork, paymentPublicKey: string, opts: UtxoToSpendableOpts): Spendable | Promise; export declare function utxoSelect({ feeRate, utxos, utxoToSpendables, outputs, }: { feeRate: number; utxos: UtxoWithTx[]; utxoToSpendables: Partial; outputs: TransactionOutput[]; }): Promise<{ inputs: TransactionInputUpdate[]; totalSats: bigint; changeSats: bigint; }>; export declare function switchUtxoToSpendable(utxo: UtxoWithTx, utxoToSpendable: Partial): Promise; export {};