"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PsbtBase = void 0;
const bip32_js_1 = require("./bip32.js");
class PsbtBase {
    _wasm;
    constructor(wasm) {
        this._wasm = wasm;
    }
    inputCount() {
        return this._wasm.input_count();
    }
    outputCount() {
        return this._wasm.output_count();
    }
    version() {
        return this._wasm.version();
    }
    lockTime() {
        return this._wasm.lock_time();
    }
    unsignedTxId() {
        return this._wasm.unsigned_tx_id();
    }
    serialize() {
        return this._wasm.serialize();
    }
    getInputs() {
        return this._wasm.get_inputs();
    }
    getOutputs() {
        return this._wasm.get_outputs();
    }
    getGlobalXpubs() {
        return this._wasm.get_global_xpubs().map((w) => bip32_js_1.BIP32.fromWasm(w));
    }
    removeInput(index) {
        this._wasm.remove_input(index);
    }
    removeOutput(index) {
        this._wasm.remove_output(index);
    }
    setKV(key, value) {
        this._wasm.set_kv(key, value);
    }
    getKV(key) {
        return this._wasm.get_kv(key) ?? undefined;
    }
    setInputKV(index, key, value) {
        this._wasm.set_input_kv(index, key, value);
    }
    getInputKV(index, key) {
        return this._wasm.get_input_kv(index, key) ?? undefined;
    }
    setOutputKV(index, key, value) {
        this._wasm.set_output_kv(index, key, value);
    }
    getOutputKV(index, key) {
        return this._wasm.get_output_kv(index, key) ?? undefined;
    }
    deleteKV(key) {
        this._wasm.delete_kv(key);
    }
    deleteInputKV(index, key) {
        this._wasm.delete_input_kv(index, key);
    }
    deleteOutputKV(index, key) {
        this._wasm.delete_output_kv(index, key);
    }
}
exports.PsbtBase = PsbtBase;
