import { FixedScriptWalletNamespace } from "./wasm/wasm_utxo";
/**
 * Create the output script for a given wallet keys and chain and index
 */
export function outputScript(keys, chain, index, network) {
    return FixedScriptWalletNamespace.output_script(keys, chain, index, network);
}
/**
 * Create the address for a given wallet keys and chain and index and network.
 * Wrapper for outputScript that also encodes the script to an address.
 * @param keys - The wallet keys to use.
 * @param chain - The chain to use.
 * @param index - The index to use.
 * @param network - The network to use.
 * @param addressFormat - The address format to use.
 *   Only relevant for Bitcoin Cash and eCash networks, where:
 *   - "default" means base58check,
 *   - "cashaddr" means cashaddr.
 */
export function address(keys, chain, index, network, addressFormat) {
    return FixedScriptWalletNamespace.address(keys, chain, index, network, addressFormat);
}
import { BitGoPsbt as WasmBitGoPsbt } from "./wasm/wasm_utxo";
export class BitGoPsbt {
    constructor(wasm) {
        this.wasm = wasm;
    }
    /**
     * Deserialize a PSBT from bytes
     * @param bytes - The PSBT bytes
     * @param network - The network to use for deserialization (either utxolib name like "bitcoin" or coin name like "btc")
     * @returns A BitGoPsbt instance
     */
    static fromBytes(bytes, network) {
        const wasm = WasmBitGoPsbt.from_bytes(bytes, network);
        return new BitGoPsbt(wasm);
    }
    /**
     * Parse transaction with wallet keys to identify wallet inputs/outputs
     * @param walletKeys - The wallet keys to use for identification
     * @param replayProtection - Scripts that are allowed as inputs without wallet validation
     * @returns Parsed transaction information
     */
    parseTransactionWithWalletKeys(walletKeys, replayProtection) {
        return this.wasm.parse_transaction_with_wallet_keys(walletKeys, replayProtection);
    }
    /**
     * Parse outputs with wallet keys to identify which outputs belong to a wallet
     * with the given wallet keys.
     *
     * This is useful in cases where we want to identify outputs that belong to a different
     * wallet than the inputs.
     *
     * @param walletKeys - The wallet keys to use for identification
     * @returns Array of parsed outputs
     * @note This method does NOT validate wallet inputs. It only parses outputs.
     */
    parseOutputsWithWalletKeys(walletKeys) {
        return this.wasm.parse_outputs_with_wallet_keys(walletKeys);
    }
}
