BCHTransactionBuilder class

Constructors

BCHTransactionBuilder({required List<BitcoinOutput> outPuts, required BigInt fee, required BasedUtxoNetwork network, required List<UtxoWithAddress> utxos, String? memo, bool enableRBF = false, bool isFakeTransaction = false})

Properties

enableRBF bool
final
fee BigInt
final
hashCode int
The hash code for this object.
no setterinherited
isFakeTransaction bool
final
memo String?
final
network BasedUtxoNetwork
final
outPuts List<BitcoinOutput>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
utxos List<UtxoWithAddress>
final

Methods

addScripts({required UtxoWithAddress utxo, required TxInput input, required List<String> signatures}) → void
buildInputs() List<TxInput>
buildInputScriptPubKeys(UtxoWithAddress utxo) Script
It is used to make the appropriate scriptSig
buildMiltisigUnlockingScript(List<String> signedDigest, UtxoWithAddress utx) List<String>
buildP2wshOrP2shScriptSig constructs and returns a script signature (represented as a List of strings) for a Pay-to-Witness-Script-Hash (P2WSH) or Pay-to-Script-Hash (P2SH) input. The function combines the signed transaction digest with the script details of the multi-signature address owned by the UTXO owner. Parameters:
buildOutputs() List<TxOutput>
buildOutputScriptPubKey(BitcoinOutput addr) Script
buildTransaction(BitcoinSignerCallBack sign) BtcTransaction
buildUnlockingScript(String signedDigest, UtxoWithAddress utx) List<String>
generateTransactionDigest(Script scriptPubKeys, int input, UtxoWithAddress utox, BtcTransaction transaction) List<int>
generateTransactionDigest generates and returns a transaction digest for a given input in the context of a Bitcoin transaction. The digest is used for signing the transaction input. The function takes into account whether the associated UTXO is Segregated Witness (SegWit) or Pay-to-Taproot (P2TR), and it computes the appropriate digest based on these conditions. Parameters:
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
opReturn(String message) Script
sumOutputAmounts() BigInt
Total amount to spend excluding fees
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

estimateTransactionSize({required List<UtxoWithAddress> utxos, required List<BitcoinAddress> outputs, required BitcoinNetwork network, String? memo, bool enableRBF = false}) int
This method is used to create a dummy transaction, allowing us to obtain the size of the original transaction before conducting the actual transaction. This helps us estimate the transaction cost