You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
604 B
21 lines
604 B
export interface CfdSellOrderPayload {
|
|
price: number;
|
|
min_quantity: number;
|
|
max_quantity: number;
|
|
}
|
|
|
|
export async function postCfdSellOrderRequest(payload: CfdSellOrderPayload) {
|
|
let res = await fetch(`/api/order/sell`, {
|
|
method: "POST",
|
|
body: JSON.stringify(payload),
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
credentials: "include",
|
|
});
|
|
|
|
if (!res.status.toString().startsWith("2")) {
|
|
console.log("Status: " + res.status + ", " + res.statusText);
|
|
throw new Error("failed to publish new order");
|
|
}
|
|
}
|
|
|