observe deposit txs before recording context after offer taken

This commit is contained in:
woodser 2024-01-07 16:15:48 -05:00
parent 6bd9f29063
commit 2f581d87b2
3 changed files with 15 additions and 11 deletions

View file

@ -1037,8 +1037,10 @@ class HavenoClient {
.setPaymentAccountId(paymentAccountId);
if (amount)
request.setAmount(amount.toString());
HavenoUtils_1.default.log(0, "Taking offer with taker amount: " + amount);
return (await this._tradesClient.takeOffer(request, { password: this._password })).getTrade();
const resp = await this._tradesClient.takeOffer(request, { password: this._password });
if (resp.getTrade())
return resp.getTrade();
throw new HavenoError_1.default(resp.getFailureReason()?.getDescription(), resp.getFailureReason()?.getAvailabilityResult());
}
catch (e) {
throw new HavenoError_1.default(e.message, e.code);