bitcoins.transaction library

Classes

AuthoredTx
InputDetail
input detail
InputSource
input source
MsgTx
Message transaction
OutPoint
Out Point
Store
Store
TxIn
transaction input
TxOut
transaction output
Utxo
Unspent Transaction Output

Constants

BASE_ENCODING → const int
1
GENERATED_TX_VERSION → const int
GENERATED_TX_VERSION is the version of the transaction being generated. It is defined as a constant here rather than using the wire.TxVersion constant since a change in the transaction version will potentially require changes to the generated transaction. Thus, using the wire constant for the generated transaction version could allow creation of invalid transactions for the updated version.
2
MAX_MESSAGE_PAYLOAD → const int
MAX_MESSAGE_PAYLOAD is the maximum bytes a message can be regardless of other individual limits imposed by messages themselves.
(1024 * 1024 * 32)
MAX_TX_IN_PER_MESSAGE → const int
MAX_TX_IN_PER_MESSAGE is the maximum number of transactions inputs that a transaction which fits into a message could possibly have.
(MAX_MESSAGE_PAYLOAD ~/ MIN_TX_IN_PAYLOAD) + 1
MAX_TX_IN_SEQUENCE_NUM → const int
MAX_TX_IN_SEQUENCE_NUM is the maximum sequence number the sequence field of a transaction input can be.
0xffffffff
MAX_TX_OUT_PER_MESSAGE → const int
MAX_TX_OUT_PER_MESSAGE is the maximum number of transactions outputs that a transaction which fits into a message could possibly have.
(MAX_MESSAGE_PAYLOAD ~/ MIN_TX_OUT_PAYLOAD) + 1
MAX_UINT_16 → const int
1 << 16 - 1
MAX_UINT_32 → const int
1 << 32 - 1
MAX_WITNESS_ITEM_SIZE → const int
11000
MIN_TX_IN_PAYLOAD → const int
MIN_TX_IN_PAYLOAD is the minimum payload size for a transaction input. PreviousOutPoint.Hash + PreviousOutPoint.Index 4 bytes + PreviousOutPoint.Tree 1 byte + Varint for SignatureScript length 1 byte + Sequence 4 bytes.
11 + chainhash.HASH_SIZE
MIN_TX_OUT_PAYLOAD → const int
MIN_TX_OUT_PAYLOAD is the minimum payload size for a transaction output. Value 8 bytes + Varint for PkScript length 1 byte.
9
WITNESS_ENCODING → const int
WITNESS_ENCODING encodes all messages other than transaction messages using the default bitcoins wire protocol specification. For transaction messages, the new encoding format detailed in BIP0144 will be used.
2

Functions

addAllInputScripts(MsgTx tx, List<Uint8List> prevPkScripts, List<Amount> inputValues, Params net, KeyClosure kdb, ScriptClosure sdb) → void
AddAllInputScripts modifies transaction a transaction by adding inputs scripts for each input. Previous output scripts being redeemed by each input are passed in prevPkScripts and the slice length must match the number of inputs. Private keys and redeem scripts are looked up using a SecretsSource based on the previous output script.
copyBytes(ByteData buf, Uint8List bytes, [dynamic offset = 0]) int
copy bytes
readVarInt(ByteData buf, [int offset = 0]) List<int>
ReadVarInt reads a variable length integer from r and returns it as a uint64.
unsignedTransaction(List<TxOut> outputs, Amount relayFeePerKb, Function fetchInputs, ChangeSource fetchChange) AuthoredTx
creates an unsigned transaction paying to one or more non-change outputs. An appropriate transaction fee is included based on the transaction size. [...]
varIntSerializeSize(int val) int
var int serialize size
writeTxOut(ByteData buf, TxOut to, int offset) int
write TxOut
writeUInt64BE(ByteData buf, int val, [dynamic offset = 0]) int
write uint64 big
writeUInt64LE(ByteData buf, int val, [dynamic offset = 0]) int
write uint64 little
writeVarBytes(ByteData buf, Uint8List bytes, [dynamic offset = 0]) int
write var bytes
writeVarInt(ByteData buf, int val, [int offset = 0]) int
write var int
writeVarString(ByteData buf, String str, [int offset = 0]) int
write var string

Typedefs

SelectInputs = InputDetail Function(Amount target)