MsgTx class

Bitcoin transaction message This message contains a complete Bitcoin transaction with inputs and outputs.

Inheritance

Constructors

MsgTx({int version = 1, List<TxIn>? txIn, List<TxOut>? txOut, int lockTime = 0})
MsgTx.coinbase({required Uint8List coinbaseData, required List<TxOut> outputs, int version = 1, int lockTime = 0})
Create a coinbase transaction (for mining rewards)
factory

Properties

command String
Get the command string for this message type
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
isCoinbase bool
Check if this is a coinbase transaction
no setter
lockTime int
getter/setter pair
maxPayloadLength int
Get maximum payload length for this message type
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializedSize int
Get serialized size in bytes
no setter
txid String
Get transaction ID as hex string
no setter
txIn List<TxIn>
getter/setter pair
txOut List<TxOut>
getter/setter pair
version int
getter/setter pair
virtualSize int
Calculate virtual size for fee estimation
no setter

Methods

calculateFee() int?
Calculate transaction fee (requires UTXO lookup for inputs)
calculateHash() Hash
Calculate transaction hash (TXID)
calculateTotalInput() int?
Calculate total input value (returns null if any input references unknown outputs)
calculateTotalOutput() int
Calculate total output value
decode(Uint8List data, int protocolVersion, MessageEncoding encoding) → void
Decode message from bytes
override
encode(int protocolVersion, MessageEncoding encoding) Uint8List
Encode message to bytes
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize(int protocolVersion, BitcoinNetwork network) Uint8List
Serialize complete message with header
inherited
toString() String
A string representation of this object.
override

Operators

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

Static Methods

deserialize(Uint8List data, int protocolVersion, MessageEncoding encoding) MsgTx
Factory method for deserialization
registerWithFactory() → void
Register this message type with the factory