diff --git a/package-lock.json b/package-lock.json index 3b5f2f8..5458d7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@siebly/htx-api", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@siebly/htx-api", - "version": "1.0.4", + "version": "1.0.5", "license": "MIT", "dependencies": { "axios": "1.18.1", diff --git a/package.json b/package.json index 7fabab0..4ccf068 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@siebly/htx-api", - "version": "1.0.4", + "version": "1.0.5", "description": "Complete & robust Node.js SDK for HTX's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "scripts": { "clean": "node scripts/clean.mjs", diff --git a/src/types/request/futures.types.ts b/src/types/request/futures.types.ts index 220bd2d..37d81d9 100644 --- a/src/types/request/futures.types.ts +++ b/src/types/request/futures.types.ts @@ -114,8 +114,8 @@ export type FuturesTrailingOrderPriceType = /** V5 order type */ export type FuturesV5OrderType = 'market' | 'limit' | 'post_only'; -/** Time in force */ -export type FuturesTimeInForce = 'fok' | 'ioc' | 'gtc'; +/** Time in force. `rpi` places an RPI order. */ +export type FuturesTimeInForce = 'fok' | 'ioc' | 'gtc' | 'rpi'; /** Trigger price type */ export type FuturesTriggerPriceType = 'last' | 'market'; diff --git a/src/types/request/spot.types.ts b/src/types/request/spot.types.ts index 15fc3c7..ca76ebb 100644 --- a/src/types/request/spot.types.ts +++ b/src/types/request/spot.types.ts @@ -240,6 +240,8 @@ export interface SpotGetOrderHistory48hReq { direct?: 'prev' | 'next'; /** Items per response [10-1000]. Default 100 */ size?: number; + /** created-at: order creation time. updated-at: last update time. */ + 'sort-by'?: 'created-at' | 'updated-at'; } /** Req for GET /v1/order/matchresults (search match results) */ diff --git a/src/types/response/futures.types.ts b/src/types/response/futures.types.ts index 43d4acc..65df379 100644 --- a/src/types/response/futures.types.ts +++ b/src/types/response/futures.types.ts @@ -456,6 +456,10 @@ export interface FuturesTrade { business_type?: string; trade_turnover?: string | number; symbol?: string; + /** Whether the trade involved an RPI order. USDT-M uses snake_case. */ + is_rpi_trade?: boolean | number | string; + /** Whether the trade is an RPI trade. Coin-M uses the hyphenated name. */ + 'is-rpi-trade'?: boolean | number | string; } /** Last trade tick from market/trade. Payload in "tick". */ diff --git a/src/types/response/ws.ts b/src/types/response/ws.ts index d004371..9f05a2b 100644 --- a/src/types/response/ws.ts +++ b/src/types/response/ws.ts @@ -61,3 +61,27 @@ export interface WsSpotFullDepthTick { version?: number; ts?: number; } + +/** Tick from USDT-M `market.$contract_code.full_depth.$type` (includes RPI orders) */ +export interface WsLinearSwapFullDepthTick { + mrid?: number; + id?: number; + bids?: [number, number][]; + asks?: [number, number][]; + ts?: number; + version?: number; + ch?: string; +} + +/** Trade from USDT-M `market.$contract_code.trade.detail` (sub and req) */ +export interface WsLinearSwapTradeDetail { + id?: number; + price?: number | string; + amount?: number | string; + direction?: string; + ts?: number; + quantity?: number | string; + trade_turnover?: number | string; + /** Whether the trade involved an RPI order */ + is_rpi_trade?: boolean | number | string; +} diff --git a/src/types/websockets/ws-subscriptions.ts b/src/types/websockets/ws-subscriptions.ts index 9980c37..1091e92 100644 --- a/src/types/websockets/ws-subscriptions.ts +++ b/src/types/websockets/ws-subscriptions.ts @@ -32,6 +32,7 @@ export const WS_SPOT_PRIVATE_TOPICS = [ export const WS_DERIVATIVES_PUBLIC_TOPICS = [ 'market.$contract_code.kline.$period', 'market.$contract_code.depth.$type', + 'market.$contract_code.full_depth.$type', 'market.$contract_code.depth.size_${size}.high_freq', 'market.$contract_code.detail', 'market.$contract_code.bbo',