mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-07-27 05:03:35 +00:00
comments
This commit is contained in:
@ -42,40 +42,40 @@ impl PublicOffers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PublicOffer {
|
impl PublicOffer { tbd
|
||||||
pub fn take(&self, taker_config: &TraderSettings) -> Result<BondRequirementResponse> {
|
// pub fn take(&self, taker_config: &TraderSettings) -> Result<BondRequirementResponse> {
|
||||||
let client = reqwest::blocking::Client::new();
|
// let client = reqwest::blocking::Client::new();
|
||||||
let res = client
|
// let res = client
|
||||||
.post(format!(
|
// .post(format!(
|
||||||
"{}{}",
|
// "{}{}",
|
||||||
taker_config.coordinator_endpoint, "/take-offer"
|
// taker_config.coordinator_endpoint, "/take-offer"
|
||||||
))
|
// ))
|
||||||
.json(self)
|
// .json(self)
|
||||||
.send()?
|
// .send()?
|
||||||
.json::<BondRequirementResponse>()?;
|
// .json::<BondRequirementResponse>()?;
|
||||||
Ok(res)
|
// Ok(res)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OfferTakenRequest {
|
impl OfferTakenRequest { // tbd
|
||||||
pub fn taker_request(
|
// pub fn taker_request(
|
||||||
bond: &Bond,
|
// bond: &Bond,
|
||||||
mut musig_data: &MuSigData,
|
// mut musig_data: &MuSigData,
|
||||||
taker_config: &TraderSettings,
|
// taker_config: &TraderSettings,
|
||||||
) -> Result<PartiallySignedTransaction> {
|
// ) -> Result<PartiallySignedTransaction> {
|
||||||
let request = RequestOfferPsbt {
|
// let request = RequestOfferPsbt {
|
||||||
offer:
|
// offer:
|
||||||
};
|
// };
|
||||||
|
|
||||||
let client = reqwest::blocking::Client::new();
|
// let client = reqwest::blocking::Client::new();
|
||||||
let res = client
|
// let res = client
|
||||||
.post(format!(
|
// .post(format!(
|
||||||
"{}{}",
|
// "{}{}",
|
||||||
taker_config.coordinator_endpoint, "/submit-taker-bond"
|
// taker_config.coordinator_endpoint, "/submit-taker-bond"
|
||||||
))
|
// ))
|
||||||
.json(self)
|
// .json(self)
|
||||||
.send()?
|
// .send()?
|
||||||
.json::<OfferTakenResponse>()?;
|
// .json::<OfferTakenResponse>()?;
|
||||||
Ok(res)
|
// Ok(res)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,14 @@ use super::utils::*;
|
|||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
impl ActiveOffer {
|
impl ActiveOffer {
|
||||||
pub fn take(
|
// pub fn take( tbd
|
||||||
trading_wallet: &TradingWallet,
|
// trading_wallet: &TradingWallet,
|
||||||
taker_config: &TraderSettings,
|
// taker_config: &TraderSettings,
|
||||||
offer: &PublicOffer,
|
// offer: &PublicOffer,
|
||||||
) -> Result<ActiveOffer> {
|
// ) -> Result<ActiveOffer> {
|
||||||
let bond_conditions: BondRequirementResponse = offer.take(taker_config)?;
|
// let bond_conditions: BondRequirementResponse = offer.take(taker_config)?;
|
||||||
let (bond, mut musig_data, payout_address) =
|
// let (bond, mut musig_data, payout_address) =
|
||||||
trading_wallet.trade_onchain_assembly(&bond_conditions, taker_config)?;
|
// trading_wallet.trade_onchain_assembly(&bond_conditions, taker_config)?;
|
||||||
// let trading_psbt =
|
// let trading_psbt =
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user