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