TransactionBuilder class
Toolbox for creating a transaction, that can be broadcasted to BCH network. Works only as an instance created through one of the factories or a constructor
Constructors
- TransactionBuilder({Network network, int maximumFeeRate })
- Creates an empty transaction builder
- TransactionBuilder.fromTransaction(Transaction transaction, [ Network network ])
-
Creates a builder from pre-built transaction
factory
Properties
- DEFAULT_SEQUENCE → int
-
final
- prevTxSet → Map
-
read-only
- SIGHASH_ALL → int
-
final
- SIGHASH_ANYONECANPAY → int
-
final
- SIGHASH_BITCOINCASHBIP143 → int
-
final
- SIGHASH_NONE → int
-
final
- SIGHASH_SINGLE → int
-
final
- tx → Transaction
-
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
addInput(
dynamic txHashOrInstance, int vout, [ int sequence, Uint8List prevOutScript ]) → int - Add input from transaction data, which can be: [...]
-
addOutput(
dynamic data, int value) → int - Adds transaction output, which can be provided as: [...]
-
build(
) → Transaction - Build signed transaction
-
buildIncomplete(
) → Transaction - Untested so far
-
getByteCount(
[bool addChangeOutput = true ]) → int -
Calculates byte count of this transaction. If
addChangeOutput
is true, it will arbitrarily add one output to indicate, that the developer plans to add change address later based on a result of this calculation [...] -
setLockTime(
int locktime) → dynamic -
Sets transaction's locktime. Throw's
ArgumentError
iflocktime
is out of range -
setVersion(
int version) → dynamic -
Sets version of the transaction. Throws
ArgumentError
if theversion
is incompatible -
sign(
int vin, ECPair keyPair, int value, [ int hashType = Transaction.SIGHASH_ALL ]) → dynamic -
Add signature for the input
vin
usingkeyPair
and with a specifiedvalue
[...] -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited