Transactions
Transaction
¶
Construction Examples:
→ See the Transactions guide for more options.
Coerces from:
Bytes– raw transaction serializationArray– transaction construction fields (seetx())Psbt– as theunsigned_tx
Underlying Type: bitcoin::Transaction
tx()
¶
tx(Array<Tagged>|Bytes|Psbt|Transaction) -> Transaction
txid()
¶
txid(Transaction) -> Hash
Aliased as: tx::id()
Rust source code: src/stdlib/btc.rs:N/A
tx::sighash()
¶
tx::sighash(
tx: Transaction,
input_index: Int,
utxos: Array<TxOut>,
sighash_ty: Int|Bytes|String = SIGHASH_ALL,
tap_leaf: Script|Policy|TapLeafHash = None
) -> Bytes
Minsc source code: src/stdlib/btc.minsc:N/A
tx::sign()
¶
tx::sign(tx: Transaction, utxos: Array<TxOut>, keys: PsbtSigningKeys) -> Int
Sign all tx inputs using the provided keys.
Also see: psbt::sign()
Minsc source code: src/stdlib/btc.minsc:N/A
tx::fee()
¶
tx::fee(tx: Transaction, utxos: Array<TxOut>) -> Int
Calculate the tx fee given the utxos spent by it.
Throws:
- If the number of
utxosdoesn't match the number oftxinputs - If
output amount > input amount - If integer overflow occurs when adding UTXO amounts
(uses signed
i64, can represent up to ~92 billion BTC)
Also see: psbt::fee()
Minsc source code: src/stdlib/btc.minsc:N/A
tx::with_witness()
¶
tx::with_witness(tx: Transaction, witnesses: Array<Witness|Int:Witness>) -> Transaction
Rust source code: src/stdlib/btc.rs:N/A
tx::strip_witness()
¶
tx::strip_witness(Transaction) -> Transaction
Minsc source code: src/stdlib/btc.minsc:N/A