pub trait TxSenderTxBuilder:
Send
+ Sync
+ 'static {
type SpendableInput: SpendableInputInfo;
// Required methods
fn build_child_tx<S: TxSenderSigner>(
p2a_anchor: OutPoint,
anchor_sat: Amount,
fee_payer_utxos: Vec<Self::SpendableInput>,
change_address: Address,
required_fee: Amount,
signer: &S,
) -> Result<Transaction, BridgeError>;
fn utxos_to_spendable_inputs(
utxos: Vec<(Txid, u32, Amount)>,
signer_address: &Address,
) -> Vec<Self::SpendableInput>;
}Expand description
Trait for building child transactions in the transaction sender.
This abstraction allows the core crate to provide SpendableTxIn-based transaction building
using TxHandler, while keeping the tx-sender crate independent of the builder module.
All methods are static - no instance of this trait is stored.
Required Associated Types§
Sourcetype SpendableInput: SpendableInputInfo
type SpendableInput: SpendableInputInfo
The type representing a spendable transaction input.
In core, this would be SpendableTxIn.
Required Methods§
Sourcefn build_child_tx<S: TxSenderSigner>(
p2a_anchor: OutPoint,
anchor_sat: Amount,
fee_payer_utxos: Vec<Self::SpendableInput>,
change_address: Address,
required_fee: Amount,
signer: &S,
) -> Result<Transaction, BridgeError>
fn build_child_tx<S: TxSenderSigner>( p2a_anchor: OutPoint, anchor_sat: Amount, fee_payer_utxos: Vec<Self::SpendableInput>, change_address: Address, required_fee: Amount, signer: &S, ) -> Result<Transaction, BridgeError>
Builds a child transaction for CPFP.
This method constructs a child transaction that spends the P2A anchor output and fee payer UTXOs, paying the required fees for the CPFP package.
§Arguments
p2a_anchor- The P2A anchor output to spendanchor_sat- Amount in the anchor outputfee_payer_utxos- UTXOs to fund the child transactionchange_address- Address for the change outputrequired_fee- The calculated required fee for the packagesigner_address- The signer’s address (for script pubkey)signer- The signer to sign the transaction inputs
§Returns
A signed child transaction ready for package submission.
Sourcefn utxos_to_spendable_inputs(
utxos: Vec<(Txid, u32, Amount)>,
signer_address: &Address,
) -> Vec<Self::SpendableInput>
fn utxos_to_spendable_inputs( utxos: Vec<(Txid, u32, Amount)>, signer_address: &Address, ) -> Vec<Self::SpendableInput>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.