Skip to content

Commit da93787

Browse files
committed
fix: getOrder... has lowercase g. Should be upper
1 parent 02d4bde commit da93787

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/components/solver/GetQuotes.svelte

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script lang="ts">
2-
import type { getOrdersEvent } from "./QuoteCommon";
2+
import type { GetOrdersEvent } from "./QuoteCommon";
33
const API_URL = "https://catalyst-order-server-0140d799e2f7.herokuapp.com/";
44
5-
async function getOrders(): Promise<getOrdersEvent> {
5+
async function getOrders(): Promise<GetOrdersEvent> {
66
const orderServerResponse = await fetch(API_URL + "orders/", {
77
method: "post",
88
});
9-
const fetchedOrders = (await orderServerResponse.json()) as getOrdersEvent;
9+
const fetchedOrders = (await orderServerResponse.json()) as GetOrdersEvent;
1010
1111
return fetchedOrders;
1212
}
1313
14-
let request: undefined | Promise<getOrdersEvent> = undefined;
14+
let request: undefined | Promise<GetOrdersEvent> = undefined;
1515
</script>
1616

1717
<!-- <a

src/components/solver/QuoteCommon.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export type CrossChainOrder = {
3838
orderContext: DutchAuctionData | LimitOrderData;
3939
};
4040

41-
export type getOrderData = {
41+
export type GetOrderData = {
4242
order: CrossChainOrder;
4343
orderKeyHash: string | undefined; // initially but will become always defined.
4444
quote: {
@@ -53,7 +53,7 @@ export type getOrderData = {
5353
submitTime: number;
5454
};
5555

56-
export type getOrdersEvent = {
57-
orders: getOrderData[];
56+
export type GetOrdersEvent = {
57+
orders: GetOrderData[];
5858
pagination: any;
5959
};

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ type CrossChainOrder = {
139139

140140
const API_URL = "https://orders.catalyst.exchange/"
141141

142-
type getOrderData = {
142+
type GetOrderData = {
143143
order: CrossChainOrder,
144144
orderKeyHash: string | undefined, // initially but will become always defined.
145145
quote: {
@@ -154,14 +154,14 @@ type getOrderData = {
154154
submitTime: number
155155
}
156156

157-
type getOrdersEvent = {
158-
orders: getOrderData[],
157+
type GetOrdersEvent = {
158+
orders: GetOrderData[],
159159
pagination: any
160160
}
161161

162-
async function getOrders(): getOrdersEvent {
162+
async function getOrders(): GetOrdersEvent {
163163
const orderServerResponse = await fetch(API_URL + "orders/");
164-
const fetchedOrders = await orderServerResponse.json() as getOrdersEvent;
164+
const fetchedOrders = await orderServerResponse.json() as GetOrdersEvent;
165165

166166
return fetchedOrders;
167167
}
@@ -194,13 +194,13 @@ Unlike the API endpoint, orders delivered over the websocket connected are not f
194194

195195
### Evaluate Orders
196196

197-
After fetching an order, it is expected that the solver evaluates the order. There are several helpful context pointers in the returned order, like `getOrderData.quote` which returns the price context used to price the inputs and outputs. If you trust the order server, it is sufficient to validate the quote and check that the solver supports the origin chain: `getOrderData.order.originChainId` and the outputs chains: `getOrderData.order.orderData.outputs[...].chainId` along with their respective tokens `input|output[].token` These parameters will always be present regardless of order type.
197+
After fetching an order, it is expected that the solver evaluates the order. There are several helpful context pointers in the returned order, like `GetOrderData.quote` which returns the price context used to price the inputs and outputs. If you trust the order server, it is sufficient to validate the quote and check that the solver supports the origin chain: `GetOrderData.order.originChainId` and the outputs chains: `GetOrderData.order.orderData.outputs[...].chainId` along with their respective tokens `input|output[].token` These parameters will always be present regardless of order type.
198198

199-
Some orders may be exclusive. If `getOrderData.order.orderData.verificationContract` is defined and not `address(0)`, it will be exclusive until `getOrderData.order.orderData.slopeStartingTime`. In these cases, if they aren't exclusive to you wait until `getOrderData.order.orderData.slopeStartingTime` before initiating the order.
199+
Some orders may be exclusive. If `GetOrderData.order.orderData.verificationContract` is defined and not `address(0)`, it will be exclusive until `GetOrderData.order.orderData.slopeStartingTime`. In these cases, if they aren't exclusive to you wait until `GetOrderData.order.orderData.slopeStartingTime` before initiating the order.
200200

201201
### Initiate Orders
202202

203-
After fetching and validatnig an order, it has to be submitted on-chain. Catalyst Orders arrive signed: `getOrderData.signature`. The signature is multi-purpose. It is a permit2 signature and allows our contracts to pull the submittor's tokens and ensures that the user approves of the order. If an order is not exclusive, it will be initiated on a first come first serve basis.
203+
After fetching and validatnig an order, it has to be submitted on-chain. Catalyst Orders arrive signed: `GetOrderData.signature`. The signature is multi-purpose. It is a permit2 signature and allows our contracts to pull the submittor's tokens and ensures that the user approves of the order. If an order is not exclusive, it will be initiated on a first come first serve basis.
204204

205205
<Tabs syncKey="lang">
206206
<TabItem label="Typescript">
@@ -334,7 +334,7 @@ Asset delivery depends on whether the destination is a VM chain or Bitcoin. For
334334

335335
### EVM deliveries
336336

337-
Call the destination chain oracle `getOrderData.order.orderData.remoteOracle`. You can get remote chain from each output `getOrderData.order.orderData.outputs[].chainId`.
337+
Call the destination chain oracle `GetOrderData.order.orderData.remoteOracle`. You can get remote chain from each output `GetOrderData.order.orderData.outputs[].chainId`.
338338

339339
<Tabs syncKey="lang">
340340
<TabItem label="Typescript">
@@ -418,12 +418,12 @@ def fill_single_chain_order(order):
418418

419419
### Bitcoin Deliveries
420420

421-
To identify whether an order contains a Bitcoin transaction, check the output token: `getOrderData.order.orderData.outputs[].token`. If the output is Bitcoin, the following must hold:
421+
To identify whether an order contains a Bitcoin transaction, check the output token: `GetOrderData.order.orderData.outputs[].token`. If the output is Bitcoin, the following must hold:
422422
- The first 30 bytes should be equal to `0x000000000000000000000000BB0000000000000000000000000000000000`. Notice the 13'th byte is `0xBB`.
423423
- The 31'th byte is reserved and not checked.
424424
- The 32'th byte contains an address version identifier. Decode as uint8.
425425

426-
If the transaction is to Bitcoin, the address (`getOrderData.order.orderData.outputs[].recipient`) will contain the relevant destination hash or witness which is not the address!
426+
If the transaction is to Bitcoin, the address (`GetOrderData.order.orderData.outputs[].recipient`) will contain the relevant destination hash or witness which is not the address!
427427

428428
<table>
429429
<thead>

0 commit comments

Comments
 (0)