Skip to content

Commit

Permalink
api+store: Add lastHop parameter for loop in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsrachelfish committed Dec 13, 2024
1 parent 601db23 commit 371fb7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/api/loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ class LoopApi extends BaseApi<LoopEvents> {
async getLoopInQuote(
amount: Big,
confTarget?: number,
lastHop?: string,
): Promise<LOOP.InQuoteResponse.AsObject> {
const req = new LOOP.QuoteRequest();
req.setAmt(amount.toString());
if (confTarget) req.setConfTarget(confTarget);
if (lastHop) req.setLoopInLastHop(b64(lastHop));
const res = await this._grpc.request(SwapClient.GetLoopInQuote, req, this._meta);
return res.toObject();
}
Expand Down
1 change: 1 addition & 0 deletions app/src/store/views/buildSwapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ class BuildSwapView {
const inQuote = await this._store.api.loop.getLoopInQuote(
amount,
this.confTarget,
this.loopInLastHop,
);
quote = {
swapFee: Big(inQuote.swapFeeSat),
Expand Down

0 comments on commit 371fb7f

Please sign in to comment.