diff --git a/package.json b/package.json index 6e7959e..4de5501 100644 --- a/package.json +++ b/package.json @@ -48,5 +48,5 @@ "peerDependencies": { "typescript": "^5.6.2" }, - "version": "0.1.54" -} \ No newline at end of file + "version": "0.1.55" +} diff --git a/src/lib/orders/OrderDisplay.tsx b/src/lib/orders/OrderDisplay.tsx index 031dfc6..c7c9cf3 100644 --- a/src/lib/orders/OrderDisplay.tsx +++ b/src/lib/orders/OrderDisplay.tsx @@ -169,11 +169,6 @@ export function OrderDisplay(props: { No orders found. - - # View all public standing orders - sf orders list --public - - # Place an order to buy compute sf buy diff --git a/src/lib/orders/index.tsx b/src/lib/orders/index.tsx index 1ddaa6f..1f53f24 100644 --- a/src/lib/orders/index.tsx +++ b/src/lib/orders/index.tsx @@ -1,6 +1,7 @@ import { type Command, Option } from "@commander-js/extra-typings"; import dayjs from "dayjs"; import { render } from "ink"; +import * as console from "node:console"; import duration from "npm:dayjs@1.11.13/plugin/duration.js"; import relativeTime from "npm:dayjs@1.11.13/plugin/relativeTime.js"; import React from "react"; @@ -12,11 +13,10 @@ import { logSessionTokenExpiredAndQuit, } from "../../helpers/errors.ts"; import { fetchAndHandleErrors } from "../../helpers/fetch.ts"; -import { getApiUrl } from "../../helpers/urls.ts"; import { parseStartDate } from "../../helpers/units.ts"; +import { getApiUrl } from "../../helpers/urls.ts"; import { OrderDisplay } from "./OrderDisplay.tsx"; import type { HydratedOrder, ListResponseBody } from "./types.ts"; -import * as console from "node:console"; dayjs.extend(relativeTime); dayjs.extend(duration); @@ -65,7 +65,7 @@ export function registerOrders(program: Command) { .addOption( new Option( "--public", - "Include public orders. Only includes open orders.", + "This option is deprecated. It's no longer possible to view public orders.", ) .conflicts(["onlyFilled", "onlyCancelled"]) .implies({ @@ -75,12 +75,12 @@ export function registerOrders(program: Command) { .option( "--min-price ", "Filter by minimum price (in cents)", - parseInt, + Number.parseInt, ) .option( "--max-price ", "Filter by maximum price (in cents)", - parseInt, + Number.parseInt, ) .option( "--min-start ", @@ -98,23 +98,38 @@ export function registerOrders(program: Command) { "--max-duration ", "Filter by maximum duration (in seconds)", ) - .option("--min-quantity ", "Filter by minimum quantity", parseInt) - .option("--max-quantity ", "Filter by maximum quantity", parseInt) + .option( + "--min-quantity ", + "Filter by minimum quantity", + Number.parseInt, + ) + .option( + "--max-quantity ", + "Filter by maximum quantity", + Number.parseInt, + ) .option( "--contract-id ", "Filter by contract ID (only for sell orders)", ) .addOption( - new Option("--only-open", "Show only open orders") - .conflicts(["onlyFilled", "onlyCancelled"]), + new Option("--only-open", "Show only open orders").conflicts([ + "onlyFilled", + "onlyCancelled", + ]), ) .addOption( - new Option("--exclude-filled", "Exclude filled orders") - .conflicts(["onlyFilled"]), + new Option("--exclude-filled", "Exclude filled orders").conflicts([ + "onlyFilled", + ]), ) .addOption( - new Option("--only-filled", "Show only filled orders") - .conflicts(["excludeFilled", "onlyCancelled", "onlyOpen", "public"]), + new Option("--only-filled", "Show only filled orders").conflicts([ + "excludeFilled", + "onlyCancelled", + "onlyOpen", + "public", + ]), ) .option( "--min-filled-at ", @@ -127,17 +142,14 @@ export function registerOrders(program: Command) { .option( "--min-fill-price ", "Filter by minimum fill price (in cents)", - parseInt, + Number.parseInt, ) .option( "--max-fill-price ", "Filter by maximum fill price (in cents)", - parseInt, - ) - .option( - "--include-cancelled", - "Include cancelled orders", + Number.parseInt, ) + .option("--include-cancelled", "Include cancelled orders") .addOption( new Option("--only-cancelled", "Show only cancelled orders") .conflicts(["onlyFilled", "onlyOpen", "public"]) @@ -161,11 +173,11 @@ export function registerOrders(program: Command) { "--max-placed-at ", "Filter by maximum placed date (ISO 8601 datestring)", ) - .option("--limit ", "Limit the number of results", parseInt) + .option("--limit ", "Limit the number of results", Number.parseInt) .option( "--offset ", "Offset the results (for pagination)", - parseInt, + Number.parseInt, ) .option("--json", "Output in JSON format") .action(async (options) => { @@ -175,8 +187,6 @@ export function registerOrders(program: Command) { side: options.side, instance_type: options.type, - include_public: options.public, - min_price: options.minPrice, max_price: options.maxPrice, min_start_date: options.minStart, @@ -236,8 +246,6 @@ export async function getOrders(props: { side?: "buy" | "sell"; instance_type?: string; - include_public?: boolean; - min_price?: number; max_price?: number; min_start_date?: string; @@ -307,9 +315,7 @@ export async function getOrders(props: { return resp.data; } -export async function submitOrderCancellationByIdAction( - orderId: string, -) { +export async function submitOrderCancellationByIdAction(orderId: string) { const loggedIn = await isLoggedIn(); if (!loggedIn) { logLoginMessageAndQuit();