diff --git a/src/api/info/_methods/_base/_schemas.ts b/src/api/info/_methods/_base/_schemas.ts index 59e4cef9..c9716751 100644 --- a/src/api/info/_methods/_base/_schemas.ts +++ b/src/api/info/_methods/_base/_schemas.ts @@ -156,6 +156,9 @@ export type FrontendOpenOrder = { * - `"Stop Limit"`: Activates as a limit order when a stop price is reached. * - `"Take Profit Market"`: Executes as a market order when a take profit price is reached. * - `"Take Profit Limit"`: Executes as a limit order when a take profit price is reached. + * - `"Twap Slice"`: Executes a single slice of a TWAP order. + * - `"Vault Close"`: Closes a vault position. + * - `"Spot Dust Conversion"`: Converts residual spot balances. * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types */ orderType: @@ -164,7 +167,10 @@ export type FrontendOpenOrder = { | "Stop Market" | "Stop Limit" | "Take Profit Market" - | "Take Profit Limit"; + | "Take Profit Limit" + | "Twap Slice" + | "Vault Close" + | "Spot Dust Conversion"; /** * Time-in-force: * - `"Gtc"`: Remains active until filled or canceled. @@ -361,7 +367,9 @@ export type UserFill = { * - `"siblingFilledCanceled"`: Canceled due to sibling ordering being filled. * - `"delistedCanceled"`: Canceled due to asset delisting. * - `"liquidatedCanceled"`: Canceled due to liquidation. + * - `"outcomeSettledCanceled"`: Canceled due to outcome market settlement. * - `"scheduledCancel"`: Canceled due to exceeding scheduled cancel deadline (dead man's switch). + * - `"internalCancel"`: Canceled due to an internal error. * - `"tickRejected"`: Rejected due to invalid tick price. * - `"minTradeNtlRejected"`: Rejected due to order notional below minimum. * - `"perpMarginRejected"`: Rejected due to insufficient margin. @@ -377,6 +385,7 @@ export type UserFill = { * - `"insufficientSpotBalanceRejected"`: Rejected due to insufficient spot balance. * - `"oracleRejected"`: Rejected due to price too far from oracle. * - `"perpMaxPositionRejected"`: Rejected due to exceeding margin tier limit at current leverage. + * - `"tooManyOpenOrdersRejected"`: Rejected due to exceeding the open order limit. */ export type OrderProcessingStatus = | "open" @@ -392,7 +401,9 @@ export type OrderProcessingStatus = | "siblingFilledCanceled" | "delistedCanceled" | "liquidatedCanceled" + | "outcomeSettledCanceled" | "scheduledCancel" + | "internalCancel" | "tickRejected" | "minTradeNtlRejected" | "perpMarginRejected" @@ -407,4 +418,5 @@ export type OrderProcessingStatus = | "openInterestIncreaseRejected" | "insufficientSpotBalanceRejected" | "oracleRejected" - | "perpMaxPositionRejected"; + | "perpMaxPositionRejected" + | "tooManyOpenOrdersRejected"; diff --git a/src/api/info/_methods/historicalOrders.ts b/src/api/info/_methods/historicalOrders.ts index 8cf0c0a4..11622b98 100644 --- a/src/api/info/_methods/historicalOrders.ts +++ b/src/api/info/_methods/historicalOrders.ts @@ -43,7 +43,9 @@ export type HistoricalOrdersResponse = { * - `"siblingFilledCanceled"`: Canceled due to sibling ordering being filled. * - `"delistedCanceled"`: Canceled due to asset delisting. * - `"liquidatedCanceled"`: Canceled due to liquidation. + * - `"outcomeSettledCanceled"`: Canceled due to outcome market settlement. * - `"scheduledCancel"`: Canceled due to exceeding scheduled cancel deadline (dead man's switch). + * - `"internalCancel"`: Canceled due to an internal error. * - `"tickRejected"`: Rejected due to invalid tick price. * - `"minTradeNtlRejected"`: Rejected due to order notional below minimum. * - `"perpMarginRejected"`: Rejected due to insufficient margin. @@ -59,6 +61,7 @@ export type HistoricalOrdersResponse = { * - `"insufficientSpotBalanceRejected"`: Rejected due to insufficient spot balance. * - `"oracleRejected"`: Rejected due to price too far from oracle. * - `"perpMaxPositionRejected"`: Rejected due to exceeding margin tier limit at current leverage. + * - `"tooManyOpenOrdersRejected"`: Rejected due to exceeding the open order limit. */ status: OrderProcessingStatus; /** Timestamp when the status was last updated (in ms since epoch). */ diff --git a/src/api/info/_methods/orderStatus.ts b/src/api/info/_methods/orderStatus.ts index 1e73f3fe..326e9665 100644 --- a/src/api/info/_methods/orderStatus.ts +++ b/src/api/info/_methods/orderStatus.ts @@ -51,7 +51,9 @@ export type OrderStatusResponse = { * - `"siblingFilledCanceled"`: Canceled due to sibling ordering being filled. * - `"delistedCanceled"`: Canceled due to asset delisting. * - `"liquidatedCanceled"`: Canceled due to liquidation. + * - `"outcomeSettledCanceled"`: Canceled due to outcome market settlement. * - `"scheduledCancel"`: Canceled due to exceeding scheduled cancel deadline (dead man's switch). + * - `"internalCancel"`: Canceled due to an internal error. * - `"tickRejected"`: Rejected due to invalid tick price. * - `"minTradeNtlRejected"`: Rejected due to order notional below minimum. * - `"perpMarginRejected"`: Rejected due to insufficient margin. @@ -67,6 +69,7 @@ export type OrderStatusResponse = { * - `"insufficientSpotBalanceRejected"`: Rejected due to insufficient spot balance. * - `"oracleRejected"`: Rejected due to price too far from oracle. * - `"perpMaxPositionRejected"`: Rejected due to exceeding margin tier limit at current leverage. + * - `"tooManyOpenOrdersRejected"`: Rejected due to exceeding the open order limit. */ status: OrderProcessingStatus; /** Timestamp when the status was last updated (in ms since epoch). */ diff --git a/src/api/subscription/_methods/orderUpdates.ts b/src/api/subscription/_methods/orderUpdates.ts index 7fb8e3e1..c77ba5b7 100644 --- a/src/api/subscription/_methods/orderUpdates.ts +++ b/src/api/subscription/_methods/orderUpdates.ts @@ -43,7 +43,9 @@ export type OrderUpdatesEvent = { * - `"siblingFilledCanceled"`: Canceled due to sibling ordering being filled. * - `"delistedCanceled"`: Canceled due to asset delisting. * - `"liquidatedCanceled"`: Canceled due to liquidation. + * - `"outcomeSettledCanceled"`: Canceled due to outcome market settlement. * - `"scheduledCancel"`: Canceled due to exceeding scheduled cancel deadline (dead man's switch). + * - `"internalCancel"`: Canceled due to an internal error. * - `"tickRejected"`: Rejected due to invalid tick price. * - `"minTradeNtlRejected"`: Rejected due to order notional below minimum. * - `"perpMarginRejected"`: Rejected due to insufficient margin. @@ -59,6 +61,7 @@ export type OrderUpdatesEvent = { * - `"insufficientSpotBalanceRejected"`: Rejected due to insufficient spot balance. * - `"oracleRejected"`: Rejected due to price too far from oracle. * - `"perpMaxPositionRejected"`: Rejected due to exceeding margin tier limit at current leverage. + * - `"tooManyOpenOrdersRejected"`: Rejected due to exceeding the open order limit. */ status: OrderProcessingStatus; /** Timestamp when the status was last updated (in ms since epoch). */ diff --git a/tests/api/info/frontendOpenOrders.test.ts b/tests/api/info/frontendOpenOrders.test.ts index 4cceac19..f770f351 100644 --- a/tests/api/info/frontendOpenOrders.test.ts +++ b/tests/api/info/frontendOpenOrders.test.ts @@ -24,6 +24,9 @@ runTest({ "#/items/properties/orderType/enum/0", "#/items/properties/orderType/enum/4", "#/items/properties/orderType/enum/5", + "#/items/properties/orderType/enum/6", + "#/items/properties/orderType/enum/7", + "#/items/properties/orderType/enum/8", "#/items/properties/tif/enum/1", "#/items/properties/tif/enum/3", "#/items/properties/tif/enum/4", diff --git a/tests/api/info/historicalOrders.test.ts b/tests/api/info/historicalOrders.test.ts index 7af36345..ea26975d 100644 --- a/tests/api/info/historicalOrders.test.ts +++ b/tests/api/info/historicalOrders.test.ts @@ -14,36 +14,31 @@ runTest({ codeTestFn: async (_t, client) => { const params: HistoricalOrdersParameters[] = [ { user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9" }, + { user: "0x8c967e73e7b15087c42a10d344cff4c96d877f1d" }, // "outcomeSettledCanceled" + { user: "0x56dd49a9eb689386daf24f5bcf946bf29d552fd5" }, // "tooManyOpenOrdersRejected" + { user: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" }, // "Spot Dust Conversion" ]; const data = await Promise.all(params.map((p) => client.historicalOrders(p))); schemaCoverage(paramsSchema, params); schemaCoverage(responseSchema, data, [ + "#/items/properties/order/properties/orderType/enum/6", + "#/items/properties/order/properties/orderType/enum/7", "#/items/properties/order/properties/tif/enum/5", "#/items/properties/status/enum/5", "#/items/properties/status/enum/6", "#/items/properties/status/enum/7", - "#/items/properties/status/enum/8", - "#/items/properties/status/enum/10", - "#/items/properties/status/enum/11", - "#/items/properties/status/enum/12", - "#/items/properties/status/enum/13", "#/items/properties/status/enum/14", "#/items/properties/status/enum/15", "#/items/properties/status/enum/16", - "#/items/properties/status/enum/17", - "#/items/properties/status/enum/18", "#/items/properties/status/enum/19", - "#/items/properties/status/enum/20", - "#/items/properties/status/enum/21", "#/items/properties/status/enum/22", "#/items/properties/status/enum/23", - "#/items/properties/status/enum/24", "#/items/properties/status/enum/25", "#/items/properties/status/enum/26", - "#/items/properties/status/enum/27", "#/items/properties/status/enum/28", + "#/items/properties/status/enum/30", "#/items/properties/order/properties/children/*", ]); }, diff --git a/tests/api/info/orderStatus.test.ts b/tests/api/info/orderStatus.test.ts index f1a910de..9ff2b536 100644 --- a/tests/api/info/orderStatus.test.ts +++ b/tests/api/info/orderStatus.test.ts @@ -23,6 +23,7 @@ runTest({ { user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", oid: 14940693141 }, // order.order.orderType = Stop Limit { user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", oid: 27379010444 }, // order.order.orderType = Take Profit Market { user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", oid: 27379156434 }, // order.order.orderType = Take Profit Limit + { user: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", oid: 57286378520 }, // order.order.orderType = Spot Dust Conversion { user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", oid: 15030144135 }, // order.order.tif = null { user: "0x563C175E6f11582f65D6d9E360A618699DEe14a9", oid: 15029784876 }, // order.order.tif = Gtc @@ -49,6 +50,8 @@ runTest({ schemaCoverage(paramsSchema, params); schemaCoverage(responseSchema, data, [ "#/anyOf/0/properties/order/properties/order/properties/children/*", + "#/anyOf/0/properties/order/properties/order/properties/orderType/enum/6", + "#/anyOf/0/properties/order/properties/order/properties/orderType/enum/7", "#/anyOf/0/properties/order/properties/order/properties/tif/enum/5", "#/anyOf/0/properties/order/properties/status/enum/3", "#/anyOf/0/properties/order/properties/status/enum/5", @@ -74,6 +77,9 @@ runTest({ "#/anyOf/0/properties/order/properties/status/enum/26", "#/anyOf/0/properties/order/properties/status/enum/27", "#/anyOf/0/properties/order/properties/status/enum/28", + "#/anyOf/0/properties/order/properties/status/enum/29", + "#/anyOf/0/properties/order/properties/status/enum/30", + "#/anyOf/0/properties/order/properties/status/enum/31", ]); }, }); diff --git a/tests/api/info/webData2.test.ts b/tests/api/info/webData2.test.ts index 57b5e808..1aca85c1 100644 --- a/tests/api/info/webData2.test.ts +++ b/tests/api/info/webData2.test.ts @@ -26,6 +26,9 @@ runTest({ "#/properties/openOrders/items/properties/orderType/enum/0", "#/properties/openOrders/items/properties/orderType/enum/4", "#/properties/openOrders/items/properties/orderType/enum/5", + "#/properties/openOrders/items/properties/orderType/enum/6", + "#/properties/openOrders/items/properties/orderType/enum/7", + "#/properties/openOrders/items/properties/orderType/enum/8", "#/properties/openOrders/items/properties/tif/enum/1", "#/properties/openOrders/items/properties/tif/enum/3", "#/properties/openOrders/items/properties/tif/enum/4", diff --git a/tests/api/subscription/openOrders.test.ts b/tests/api/subscription/openOrders.test.ts index 8f069e78..cc980e20 100644 --- a/tests/api/subscription/openOrders.test.ts +++ b/tests/api/subscription/openOrders.test.ts @@ -31,6 +31,9 @@ runTest({ "#/properties/orders/items/properties/orderType/enum/0", "#/properties/orders/items/properties/orderType/enum/4", "#/properties/orders/items/properties/orderType/enum/5", + "#/properties/orders/items/properties/orderType/enum/6", + "#/properties/orders/items/properties/orderType/enum/7", + "#/properties/orders/items/properties/orderType/enum/8", "#/properties/orders/items/properties/tif/enum/1", "#/properties/orders/items/properties/tif/enum/3", "#/properties/orders/items/properties/tif/enum/4", diff --git a/tests/api/subscription/orderUpdates.test.ts b/tests/api/subscription/orderUpdates.test.ts index 60534256..cb1bf466 100644 --- a/tests/api/subscription/orderUpdates.test.ts +++ b/tests/api/subscription/orderUpdates.test.ts @@ -60,6 +60,9 @@ runTestWithExchange({ "#/items/properties/status/enum/26", "#/items/properties/status/enum/27", "#/items/properties/status/enum/28", + "#/items/properties/status/enum/29", + "#/items/properties/status/enum/30", + "#/items/properties/status/enum/31", ]); }, });