PendingTransaction (Class)¶
A transaction ready for signing and submission.
Created by iterating over a Generator. Contains the transaction along with metadata about fees, amounts, and UTXOs being spent.
aggregate_input_amount
property
¶
The total value of all inputs in sompi.
aggregate_output_amount
property
¶
The total value of all outputs in sompi.
payment_amount
property
¶
The total payment amount in sompi (excluding change and fees), or None for sweep transactions.
transaction
property
¶
transaction: Transaction
The underlying transaction object for manual inspection or modification.
transaction_type
property
¶
The transaction type: "batch" for intermediate or "final" for last.
addresses
¶
addresses() -> list[Address]
Get the unique addresses referenced by this transaction's inputs.
| RETURNS | DESCRIPTION |
|---|---|
list[Address]
|
list[Address]: List of addresses. |
create_input_signature
¶
create_input_signature(input_index: int, private_key: PrivateKey, sighash_type: str | SighashType | None = All) -> str
Create a signature for a specific input.
| PARAMETER | DESCRIPTION |
|---|---|
input_index
|
The index of the input to sign.
TYPE:
|
private_key
|
The private key for signing.
TYPE:
|
sighash_type
|
The signature hash type (default: All).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The signature as a hex string.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If signing fails. |
fill_input
¶
fill_input(input_index: int, signature_script: Binary) -> None
Fill an input's signature script with a pre-computed signature.
| PARAMETER | DESCRIPTION |
|---|---|
input_index
|
The index of the input to fill.
TYPE:
|
signature_script
|
The signature script bytes.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If filling fails. |
get_utxo_entries
¶
get_utxo_entries() -> list[UtxoEntryReference]
Get the UTXO entries being spent by this transaction.
| RETURNS | DESCRIPTION |
|---|---|
list[UtxoEntryReference]
|
list[UtxoEntryReference]: List of UTXO entries. |
sign
¶
Sign all inputs with the provided private keys.
| PARAMETER | DESCRIPTION |
|---|---|
private_keys
|
List of PrivateKey objects for signing.
TYPE:
|
check_fully_signed
|
Verify all inputs are signed (default: None).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If signing fails or transaction is not fully signed. |
sign_input
¶
sign_input(input_index: int, private_key: PrivateKey, sighash_type: str | SighashType | None = All) -> None
Sign a specific input with a private key.
| PARAMETER | DESCRIPTION |
|---|---|
input_index
|
The index of the input to sign.
TYPE:
|
private_key
|
The private key for signing.
TYPE:
|
sighash_type
|
The signature hash type (default: All).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If signing fails. |