"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.outputScript = outputScript;
exports.address = address;
const wasm_utxo_js_1 = require("../wasm/wasm_utxo.js");
const RootWalletKeys_js_1 = require("./RootWalletKeys.js");
/**
 * Create the output script for a given wallet keys and chain and index
 */
function outputScript(keys, chain, index, network) {
    const walletKeys = RootWalletKeys_js_1.RootWalletKeys.from(keys);
    return wasm_utxo_js_1.FixedScriptWalletNamespace.output_script(walletKeys.wasm, 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.
 */
function address(keys, chain, index, network, addressFormat) {
    const walletKeys = RootWalletKeys_js_1.RootWalletKeys.from(keys);
    return wasm_utxo_js_1.FixedScriptWalletNamespace.address(walletKeys.wasm, chain, index, network, addressFormat);
}
