diff --git a/src/index.ts b/src/index.ts index 26a2a29..c4d7775 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,7 +8,12 @@ export { export { OP, RawTx, CompactSize, Script, ScriptNum } from './script.js'; export { Transaction } from './transaction.js'; export { selectUTXO } from './utxo.js'; -export { NETWORK, compareBytes as _cmpBytes, TAPROOT_UNSPENDABLE_KEY } from './utils.js'; +export { + NETWORK, + TEST_NETWORK, + compareBytes as _cmpBytes, + TAPROOT_UNSPENDABLE_KEY, +} from './utils.js'; // Utils // prettier-ignore diff --git a/src/transaction.ts b/src/transaction.ts index 26ef505..a331a68 100644 --- a/src/transaction.ts +++ b/src/transaction.ts @@ -937,9 +937,13 @@ export class Transaction { } else if (inputType.last.type === 'wpkh') { inputScript = P.EMPTY; witness = [input.partialSig[0][1], input.partialSig[0][0]]; - } else if (inputType.last.type === 'unknown' && !this.opts.allowUnknownInputs) - throw new Error('Unknown inputs not allowed'); - + } else if (inputType.last.type === 'unknown') { + if (!this.opts.allowUnknownInputs) { + throw new Error('Unknown inputs not allowed'); + } + // Trying our best to sign what we can + inputScript = Script.encode([input.partialSig[0][1], input.partialSig[0][0]]); + } // Create final scripts (generic part) let finalScriptSig: Bytes | undefined, finalScriptWitness: Bytes[] | undefined; if (inputType.type.includes('wsh-')) {