Skip to content

Commit 471064b

Browse files
committed
fix: correct UI to Order Server
1 parent 613eaaf commit 471064b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/content/docs/protocol/v2/solver.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,13 @@ websocketServer.onRequestForQuote((order) => {
525525
const quoted = orderEvaluations(order);
526526
if (quoted !== undefined)
527527
// 3. Respond to the request for quote.
528-
websocketServer.respond(quoted);
528+
fetch(API_URL + "quotes/", data, {method: "post"});
529529
});
530530
```
531531

532532
### Return Signed Orders (WIP)
533533

534-
The UI compares all received quotes from solvers and chooses the quote from the best solver. Once the user's deposit is confirmed, the UI requests the solver for a signed order. The signer has to send back a signed order that matches with quote given (within expiry). It is important that the returned order is exclusive to the user & the UI's executor (see code). This is important since the Cross Cats UI can guarantee that the assets will be delivered through a UI controlled but user owned Bitcoin address.
534+
The Order Server compares all received quotes from solvers and chooses the quote from the best solver. Once the user's deposit is confirmed, the Order Server requests the solver for a signed order. The signer has to send back a signed order that matches with quote given (within expiry). It is important that the returned order is exclusive to the user & the Order Server's executor (see code). This is important since the Cross Cats Order Server can guarantee that the assets will be delivered through a Order Server controlled but user owned Bitcoin address.
535535

536536
```typescript
537537
const websocketServer;
@@ -548,16 +548,16 @@ websocketServer.onRequestForOrder((request) => {
548548
const signedOrder = signOrderRequest(order);
549549
if (quoted === undefined) {
550550
// 3. Respond to the request for quote.
551-
websocketServer.respond("no");
551+
fetch(API_URL + "quotes/", JSON.stringify({answer: "no"}), {method: "post"});
552552
} else {
553-
websocketServer.respond(signedOrder);
553+
fetch(API_URL + "quotes/", JSON.stringify(signedOrder), {method: "post"});
554554
}
555555
});
556556
```
557557

558558
Once the signedOrder is sent & it correctly matches the expected quote, the vast vast majority of orders will be filled.
559559

560-
TODO: The UI may respond back with a transaction hash.
560+
TODO: The Order Server may respond back with a transaction hash.
561561

562562
## Prove Orders (WIP)
563563

0 commit comments

Comments
 (0)