Performs final validation and extracts the raw transaction bytes ready for broadcast.
Signature
function finalize_and_extract(pczt: WasmPczt): Uint8Array
function finalize_and_extract_hex(pczt: WasmPczt): string
Parameters
The PCZT to finalize (must be fully signed and proved)
Returns
Raw transaction bytes or hex string.
Prerequisites
Before calling, ensure:
- All transparent inputs are signed
- Orchard proofs are generated (if any Orchard outputs)
const info = t2z.inspect_pczt(pczt.to_hex());
if (!info.all_inputs_signed || !info.has_orchard_proofs) {
throw new Error('Not ready to finalize');
}
Example
// Get transaction as hex (for broadcasting)
const txHex = t2z.finalize_and_extract_hex(pczt);
console.log('Transaction size:', txHex.length / 2, 'bytes');
// Broadcast via RPC
await sendRawTransaction(txHex);
See Also