mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-07-19 01:03:30 +00:00
trader bond
This commit is contained in:
@ -11,8 +11,12 @@ use crate::wallet::{load_wallet, bond::Bond};
|
||||
|
||||
pub fn run_maker(maker_config: &TraderSettings) -> Result<()> {
|
||||
let offer_conditions = OfferCreationResponse::fetch(maker_config)?;
|
||||
|
||||
let offer_conditions = OfferCreationResponse {
|
||||
|
||||
};
|
||||
let wallet = load_wallet(maker_config)?;
|
||||
let bond = Bond::assemble(&wallet, &offer_conditions, maker_config)?;
|
||||
|
||||
dbg!(bond);
|
||||
Ok(())
|
||||
}
|
||||
|
@ -32,12 +32,14 @@ impl Bond {
|
||||
// to have the full trading sum as change as evidence for the coordinator that the maker owns
|
||||
// enough funds to cover the trade
|
||||
let (mut psbt, details) = {
|
||||
let mut builder = wallet.build_tx();
|
||||
let mut builder = wallet.build_tx()
|
||||
.coin_selection(BranchAndBoundCoinSelection::new(trader_input.trade_type.value()));
|
||||
|
||||
builder
|
||||
.coin_selection(BranchAndBoundCoinSelection::new(trader_input.trade_type.value()))
|
||||
.add_recipient(address.script_pubkey(), bond_target.locking_amount)
|
||||
.do_not_spend_change()
|
||||
.fee_rate(FeeRate::from_sat_per_vb(201.0));
|
||||
|
||||
builder.finish()?
|
||||
};
|
||||
let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
|
||||
|
Reference in New Issue
Block a user