TxAssembler class

High-level transaction builder that takes UTXOs, outputs, and a chain config to produce a fully-signed Tx.

For new code prefer the wallet-layer builder; this type is retained for the chains barrel API. Unlike its previous (broken) incarnation, build / buildAsync now attach the produced signatures and return a transaction with complete == true.

Implementers

Constructors

TxAssembler({required ChainParams chainParams, required List<AssemblerInput> inputs, required List<TxOutput> outputs, int version = Tx.currentVersion, int locktime = 0, TxOrdering ordering = TxOrdering.bip69})

Properties

chainParams ChainParams
final
hashCode int
The hash code for this object.
no setterinherited
inputs List<AssemblerInput>
final
locktime int
final
ordering TxOrdering
final
outputs List<TxOutput>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
version int
final

Methods

build(SignerCallback signer) Tx
Builds and signs the transaction synchronously.
buildAsync(AsyncSignerCallback signer) Future<Tx>
Async variant of build for hardware wallets / remote signers.
buildSignedInput(AssemblerInput meta, Uint8List derSig) TxInput
Builds the concrete signed TxInput for meta from the DER signature bytes returned by the signer (no sighash flag appended yet).
compareBytes(Uint8List a, Uint8List b) int
computeDigest(Tx tx, int index, AssemblerInput meta) Uint8List
Computes the sighash digest for the input, choosing the algorithm and - for segwit - the BIP-143 scriptCode based on AssemblerInput.type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orderedInputs() List<AssemblerInput>
orderedOutputs() List<TxOutput>
p2wpkhScriptCode(AssemblerInput meta) Uint8List
BIP-143 scriptCode for P2WPKH / nested P2WPKH: OP_DUP OP_HASH160 <20-byte keyhash> OP_EQUALVERIFY OP_CHECKSIG.
toString() String
A string representation of this object.
inherited
unsignedTx(List<AssemblerInput> ins, List<TxOutput> outs) Tx

Operators

operator ==(Object other) bool
The equality operator.
inherited