Skip to main content
Creates a Partially Constructed Zcash Transaction (PCZT) from transparent inputs and payment outputs. Implements the Creator, Constructor, and IO Finalizer roles from ZIP 374.

Signature

  • TypeScript
  • Go
  • Kotlin
function propose_transaction(
  inputs: WasmTransparentInput[],
  payments: WasmPayment[],
  change_address: string | null,
  network: 'mainnet' | 'testnet',
  expiry_height: number
): WasmPczt

Parameters

inputs
TransparentInput[]
required
Array of transparent UTXOs to spend
payments
Payment[]
required
Array of payment outputs to create
change_address
string | null
Address to receive change (Orchard or transparent)
network
string
required
'mainnet' or 'testnet'
expiry_height
number
required
Block height at which the transaction expires

Returns

A Pczt object representing the partially constructed transaction.

Example

const input = new t2z.WasmTransparentInput(
  '03abc123...',
  'ce15f716...1338',
  0,
  1_000_000n,
  '76a914...88ac',
  null
);

const payment = new t2z.WasmPayment(
  'u1recipient...',
  800_000n,
  null,
  null
);

const pczt = t2z.propose_transaction(
  [input],
  [payment],
  'u1change...',
  'testnet',
  3720100
);

Errors

ErrorCause
InvalidAddressAddress couldn’t be parsed
InsufficientFundsInputs don’t cover payments + fee
ChangeRequiredChange exists but no change address provided
OrchardBuilderNotAvailableExpiry height is before Nu5

See Also