From 557ddc90f5f4ed05c0a2dfdf47f17feef6089b44 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 8 Sep 2022 18:24:18 +0100 Subject: [PATCH] USDC request param typings --- src/types/request/index.ts | 2 + src/types/request/usdc-options.ts | 135 ++++++++++++++++++++++ src/types/request/usdc-perp.ts | 92 +++++++++++++-- src/types/request/usdc-shared.ts | 36 ++++++ src/usdc-options-client.ts | 117 +++++++++++++------ src/usdc-perpetual-client.ts | 53 ++++++--- test/usdc/options/public.read.test.ts | 4 +- test/usdc/perpetual/private.write.test.ts | 1 + 8 files changed, 382 insertions(+), 58 deletions(-) create mode 100644 src/types/request/usdc-options.ts create mode 100644 src/types/request/usdc-shared.ts diff --git a/src/types/request/index.ts b/src/types/request/index.ts index 4194535..2b797e3 100644 --- a/src/types/request/index.ts +++ b/src/types/request/index.ts @@ -1,3 +1,5 @@ export * from './account-asset'; export * from './usdt-perp'; export * from './usdc-perp'; +export * from './usdc-options'; +export * from './usdc-shared'; diff --git a/src/types/request/usdc-options.ts b/src/types/request/usdc-options.ts new file mode 100644 index 0000000..0ba1971 --- /dev/null +++ b/src/types/request/usdc-options.ts @@ -0,0 +1,135 @@ +import { OrderSide } from '../shared'; +import { USDCOrderFilter } from './usdc-perp'; +import { USDCAPICategory, USDCOrderType, USDCTimeInForce } from './usdc-shared'; + +export interface USDCOptionsContractInfoRequest { + symbol?: string; + status?: 'WAITING_ONLINE' | 'ONLINE' | 'DELIVERING' | 'OFFLINE'; + baseCoin?: string; + direction?: string; + limit?: string; + cursor?: string; +} + +export interface USDCOptionsDeliveryPriceRequest { + symbol?: string; + baseCoin?: string; + direction?: string; + limit?: string; + cursor?: string; +} + +export interface USDCOptionsRecentTradesRequest { + category: USDCAPICategory; + symbol?: string; + baseCoin?: string; + optionType?: 'Call' | 'Put'; + limit?: string; +} + +export interface USDCOptionsHistoricalVolatilityRequest { + baseCoin?: string; + period?: string; + startTime?: string; + endTime?: string; +} + +export interface USDCOptionsOrderRequest { + symbol: string; + orderType: USDCOrderType; + side: OrderSide; + orderPrice?: string; + orderQty: string; + iv?: string; + timeInForce?: USDCTimeInForce; + orderLinkId?: string; + reduceOnly?: boolean; +} + +export interface USDCOptionsModifyOrderRequest { + symbol: string; + orderId?: string; + orderLinkId?: string; + orderPrice?: string; + orderQty?: string; + iv?: string; +} + +export interface USDCOptionsCancelOrderRequest { + symbol: string; + orderId?: string; + orderLinkId?: string; +} + +export interface USDCOptionsCancelAllOrdersRequest { + symbol?: string; + baseCoin?: string; +} + +export interface USDCOptionsActiveOrdersRealtimeRequest { + orderId?: string; + orderLinkId?: string; + symbol?: string; + baseCoin?: string; + direction?: string; + limit?: number; + cursor?: string; +} + +export interface USDCOptionsActiveOrdersRequest { + category: 'OPTION'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + direction?: string; + limit?: number; + cursor?: string; +} + +export interface USDCOptionsHistoricOrdersRequest { + category: 'OPTION'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + orderStatus?: string; + direction?: string; + limit?: number; + cursor?: string; +} + +export interface USDCOptionsOrderExecutionRequest { + category: 'OPTION'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + startTime?: string; + direction?: string; + limit?: number; + cursor?: string; +} + +export interface USDCOptionsDeliveryHistoryRequest { + symbol: string; + expDate?: string; + direction?: string; + limit?: string; + cursor?: string; +} + +export interface USDCOptionsPositionsInfoExpiryRequest { + expDate?: string; + direction?: string; + limit?: string; + cursor?: string; +} + +export interface USDCOptionsModifyMMPRequest { + currency: string; + windowMs: number; + frozenPeriodMs: number; + qtyLimit: string; + deltaLimit: string; +} diff --git a/src/types/request/usdc-perp.ts b/src/types/request/usdc-perp.ts index dc2b209..6f77789 100644 --- a/src/types/request/usdc-perp.ts +++ b/src/types/request/usdc-perp.ts @@ -1,9 +1,5 @@ -export interface USDCKlineRequest { - symbol: string; - period: string; - startTime: number; - limit?: string; -} +import { OrderSide } from '../shared'; +import { USDCAPICategory, USDCOrderType, USDCTimeInForce } from './usdc-shared'; export interface USDCOpenInterestRequest { symbol: string; @@ -12,8 +8,90 @@ export interface USDCOpenInterestRequest { } export interface USDCLast500TradesRequest { - category: string; + category: USDCAPICategory; symbol?: string; baseCoin?: string; limit?: string; } + +export interface USDCSymbolDirectionLimit { + symbol?: string; + direction?: string; + limit?: string; +} + +export interface USDCSymbolDirectionLimitCursor { + symbol?: string; + direction?: string; + limit?: string; + cursor?: string; +} + +export type USDCOrderFilter = 'Order' | 'StopOrder'; + +export interface USDCPerpOrderRequest { + symbol: string; + orderType: USDCOrderType; + orderFilter: USDCOrderFilter; + side: OrderSide; + orderPrice?: string; + orderQty: string; + timeInForce?: USDCTimeInForce; + orderLinkId?: string; + reduceOnly?: boolean; + closeOnTrigger?: boolean; + takeProfit?: string; + stopLoss?: string; + tptriggerby?: string; + slTriggerBy?: string; + basePrice?: string; + triggerPrice?: string; + triggerBy?: string; + mmp?: boolean; +} + +export interface USDCPerpModifyOrderRequest { + symbol: string; + orderFilter: USDCOrderFilter; + orderId?: string; + orderLinkId?: string; + orderPrice?: string; + orderQty?: string; + takeProfit?: string; + stopLoss?: string; + tptriggerby?: string; + slTriggerBy?: string; + triggerPrice?: string; +} + +export interface USDCPerpCancelOrderRequest { + symbol: string; + orderFilter: USDCOrderFilter; + orderId?: string; + orderLinkId?: string; +} + +export interface USDCPerpActiveOrdersRequest { + category: 'PERPETUAL'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + orderFilter?: USDCOrderFilter; + direction?: string; + limit?: number; + cursor?: string; +} + +export interface USDCPerpHistoricOrdersRequest { + category: 'PERPETUAL'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + orderStatus?: string; + orderFilter?: USDCOrderFilter; + direction?: string; + limit?: number; + cursor?: string; +} diff --git a/src/types/request/usdc-shared.ts b/src/types/request/usdc-shared.ts new file mode 100644 index 0000000..f8faf59 --- /dev/null +++ b/src/types/request/usdc-shared.ts @@ -0,0 +1,36 @@ +export type USDCAPICategory = 'PERPETUAL' | 'OPTION'; + +export type USDCOrderType = 'Limit' | 'Market'; +export type USDCTimeInForce = + | 'GoodTillCancel' + | 'ImmediateOrCancel' + | 'FillOrKill' + | 'PostOnly'; + +export interface USDCKlineRequest { + symbol: string; + period: string; + startTime: number; + limit?: string; +} + +export interface USDCTransactionLogRequest { + type: string; + baseCoin?: string; + startTime?: string; + endTime?: string; + direction?: string; + limit?: string; + cursor?: string; + category?: USDCAPICategory; +} + +export interface USDCPositionsRequest { + category: USDCAPICategory; + symbol?: string; + baseCoin?: string; + expDate?: string; + direction?: string; + limit?: string; + cursor?: string; +} diff --git a/src/usdc-options-client.ts b/src/usdc-options-client.ts index bfb190a..efddb67 100644 --- a/src/usdc-options-client.ts +++ b/src/usdc-options-client.ts @@ -1,4 +1,24 @@ -import { APIResponseWithTime } from './types'; +import { + APIResponseWithTime, + USDCAPIResponse, + USDCOptionsActiveOrdersRealtimeRequest, + USDCOptionsActiveOrdersRequest, + USDCOptionsCancelAllOrdersRequest, + USDCOptionsCancelOrderRequest, + USDCOptionsContractInfoRequest, + USDCOptionsDeliveryHistoryRequest, + USDCOptionsDeliveryPriceRequest, + USDCOptionsHistoricalVolatilityRequest, + USDCOptionsHistoricOrdersRequest, + USDCOptionsModifyMMPRequest, + USDCOptionsModifyOrderRequest, + USDCOptionsOrderExecutionRequest, + USDCOptionsOrderRequest, + USDCOptionsPositionsInfoExpiryRequest, + USDCOptionsRecentTradesRequest, + USDCPositionsRequest, + USDCTransactionLogRequest, +} from './types'; import { REST_CLIENT_TYPE_ENUM } from './util'; import BaseRestClient from './util/BaseRestClient'; @@ -22,27 +42,33 @@ export class USDCOptionsClient extends BaseRestClient { */ /** Query order book info. Each side has a depth of 25 orders. */ - getOrderBook(symbol: string): Promise> { + getOrderBook(symbol: string): Promise> { return this.get('/option/usdc/openapi/public/v1/order-book', { symbol }); } /** Fetch trading rules (such as min/max qty). Query for all if blank. */ - getContractInfo(params?: unknown): Promise> { + getContractInfo( + params?: USDCOptionsContractInfoRequest + ): Promise> { return this.get('/option/usdc/openapi/public/v1/symbols', params); } /** Get a symbol price/statistics ticker */ - getSymbolTicker(symbol: string): Promise> { + getSymbolTicker(symbol: string): Promise> { return this.get('/option/usdc/openapi/public/v1/tick', { symbol }); } /** Get delivery information */ - getDeliveryPrice(params?: unknown): Promise> { + getDeliveryPrice( + params?: USDCOptionsDeliveryPriceRequest + ): Promise> { return this.get('/option/usdc/openapi/public/v1/delivery-price', params); } /** Returned records are Taker Buy in default. */ - getLastTrades(params: unknown): Promise> { + getLast500Trades( + params: USDCOptionsRecentTradesRequest + ): Promise> { return this.get( '/option/usdc/openapi/public/v1/query-trade-latest', params @@ -56,7 +82,9 @@ export class USDCOptionsClient extends BaseRestClient { * It returns all data in 2 years when startTime & endTime are not passed. * Both startTime & endTime entered together or both are left blank */ - getHistoricalVolatility(params?: unknown): Promise> { + getHistoricalVolatility( + params?: USDCOptionsHistoricalVolatilityRequest + ): Promise> { return this.get( '/option/usdc/openapi/public/v1/query-historical-volatility', params @@ -76,7 +104,7 @@ export class USDCOptionsClient extends BaseRestClient { * The request status can be queried in real-time. * The response parameters must be queried through a query or a WebSocket response. */ - submitOrder(params: unknown): Promise> { + submitOrder(params: USDCOptionsOrderRequest): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/place-order', params @@ -87,8 +115,8 @@ export class USDCOptionsClient extends BaseRestClient { * Each request supports a max. of four orders. The reduceOnly parameter should be separate and unique for each order in the request. */ batchSubmitOrders( - orderRequest: unknown[] - ): Promise> { + orderRequest: USDCOptionsOrderRequest[] + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/batch-place-orders', { orderRequest } @@ -96,7 +124,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** For Options, at least one of the three parameters — price, quantity or implied volatility — must be input. */ - modifyOrder(params: unknown): Promise> { + modifyOrder( + params: USDCOptionsModifyOrderRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/replace-order', params @@ -105,8 +135,8 @@ export class USDCOptionsClient extends BaseRestClient { /** Each request supports a max. of four orders. The reduceOnly parameter should be separate and unique for each order in the request. */ batchModifyOrders( - replaceOrderRequest: unknown[] - ): Promise> { + replaceOrderRequest: USDCOptionsModifyOrderRequest[] + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/batch-replace-orders', { replaceOrderRequest } @@ -114,7 +144,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** Cancel order */ - cancelOrder(params: unknown): Promise> { + cancelOrder( + params: USDCOptionsCancelOrderRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/cancel-order', params @@ -123,8 +155,8 @@ export class USDCOptionsClient extends BaseRestClient { /** Batch cancel orders */ batchCancelOrders( - cancelRequest: unknown[] - ): Promise> { + cancelRequest: USDCOptionsCancelOrderRequest[] + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/batch-cancel-orders', { cancelRequest } @@ -132,7 +164,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** This is used to cancel all active orders. The real-time response indicates whether the request is successful, depending on retCode. */ - cancelActiveOrders(params?: unknown): Promise> { + cancelActiveOrders( + params?: USDCOptionsCancelAllOrdersRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/cancel-all', params @@ -140,7 +174,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** Query Unfilled/Partially Filled Orders(real-time), up to last 7 days of partially filled/unfilled orders */ - getActiveRealtimeOrders(params?: unknown): Promise> { + getActiveRealtimeOrders( + params?: USDCOptionsActiveOrdersRealtimeRequest + ): Promise> { return this.getPrivate( '/option/usdc/openapi/private/v1/trade/query-active-orders', params @@ -148,7 +184,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** Query Unfilled/Partially Filled Orders */ - getActiveOrders(params: unknown): Promise> { + getActiveOrders( + params: USDCOptionsActiveOrdersRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-active-orders', params @@ -156,7 +194,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** Query order history. The endpoint only supports up to 30 days of queried records */ - getHistoricOrders(params: unknown): Promise> { + getHistoricOrders( + params: USDCOptionsHistoricOrdersRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-order-history', params @@ -164,7 +204,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** Query trade history. The endpoint only supports up to 30 days of queried records. An error will be returned if startTime is more than 30 days. */ - getOrderExecutionHistory(params: unknown): Promise> { + getOrderExecutionHistory( + params: USDCOptionsOrderExecutionRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/execution-list', params @@ -174,7 +216,9 @@ export class USDCOptionsClient extends BaseRestClient { /** -> Account API */ /** The endpoint only supports up to 30 days of queried records. An error will be returned if startTime is more than 30 days. */ - getTransactionLog(params: unknown): Promise> { + getTransactionLog( + params: USDCTransactionLogRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-transaction-log', params @@ -182,15 +226,14 @@ export class USDCOptionsClient extends BaseRestClient { } /** Wallet info for USDC account. */ - getBalance(params?: unknown): Promise> { + getBalance(): Promise> { return this.postPrivate( - '/option/usdc/openapi/private/v1/query-wallet-balance', - params + '/option/usdc/openapi/private/v1/query-wallet-balance' ); } /** Asset Info */ - getAssetInfo(baseCoin?: string): Promise> { + getAssetInfo(baseCoin?: string): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-asset-info', { baseCoin } @@ -203,7 +246,7 @@ export class USDCOptionsClient extends BaseRestClient { */ setMarginMode( newMarginMode: 'REGULAR_MARGIN' | 'PORTFOLIO_MARGIN' - ): Promise> { + ): Promise> { return this.postPrivate( '/option/usdc/private/asset/account/setMarginMode', { setMarginMode: newMarginMode } @@ -211,7 +254,7 @@ export class USDCOptionsClient extends BaseRestClient { } /** Query margin mode for USDC account. */ - getMarginMode(): Promise> { + getMarginMode(): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-margin-info' ); @@ -220,7 +263,7 @@ export class USDCOptionsClient extends BaseRestClient { /** -> Positions API */ /** Query my positions */ - getPositions(params: unknown): Promise> { + getPositions(params: USDCPositionsRequest): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-position', params @@ -228,7 +271,9 @@ export class USDCOptionsClient extends BaseRestClient { } /** Query Delivery History */ - getDeliveryHistory(params: unknown): Promise> { + getDeliveryHistory( + params: USDCOptionsDeliveryHistoryRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-delivery-list', params @@ -237,8 +282,8 @@ export class USDCOptionsClient extends BaseRestClient { /** Query Positions Info Upon Expiry */ getPositionsInfoUponExpiry( - params?: unknown - ): Promise> { + params?: USDCOptionsPositionsInfoExpiryRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-position-exp-date', params @@ -248,7 +293,9 @@ export class USDCOptionsClient extends BaseRestClient { /** -> Market Maker Protection */ /** modifyMMP */ - modifyMMP(params?: unknown): Promise> { + modifyMMP( + params: USDCOptionsModifyMMPRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/mmp-modify', params @@ -256,14 +303,14 @@ export class USDCOptionsClient extends BaseRestClient { } /** resetMMP */ - resetMMP(currency: string): Promise> { + resetMMP(currency: string): Promise> { return this.postPrivate('/option/usdc/openapi/private/v1/mmp-reset', { currency, }); } /** queryMMPState */ - queryMMPState(baseCoin: string): Promise> { + queryMMPState(baseCoin: string): Promise> { return this.postPrivate('/option/usdc/openapi/private/v1/get-mmp-state', { baseCoin, }); diff --git a/src/usdc-perpetual-client.ts b/src/usdc-perpetual-client.ts index 55b2743..9c22d89 100644 --- a/src/usdc-perpetual-client.ts +++ b/src/usdc-perpetual-client.ts @@ -6,6 +6,16 @@ import { USDCKlineRequest, USDCLast500TradesRequest, USDCOpenInterestRequest, + USDCOrderFilter, + USDCPerpActiveOrdersRequest, + USDCPerpCancelOrderRequest, + USDCPerpHistoricOrdersRequest, + USDCPerpModifyOrderRequest, + USDCPerpOrderRequest, + USDCPositionsRequest, + USDCSymbolDirectionLimit, + USDCSymbolDirectionLimitCursor, + USDCTransactionLogRequest, } from './types'; import { REST_CLIENT_TYPE_ENUM } from './util'; import BaseRestClient from './util/BaseRestClient'; @@ -34,7 +44,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Fetch trading rules (such as min/max qty). Query for all if blank. */ - getContractInfo(params?: unknown): Promise> { + getContractInfo( + params?: USDCSymbolDirectionLimit + ): Promise> { return this.get('/perpetual/usdc/openapi/public/v1/symbols', params); } @@ -108,7 +120,7 @@ export class USDCPerpetualClient extends BaseRestClient { * The request status can be queried in real-time. * The response parameters must be queried through a query or a WebSocket response. */ - submitOrder(params: unknown): Promise> { + submitOrder(params: USDCPerpOrderRequest): Promise> { return this.postPrivate( '/perpetual/usdc/openapi/private/v1/place-order', params @@ -116,7 +128,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Active order parameters (such as quantity, price) and stop order parameters cannot be modified in one request at the same time. Please request modification separately. */ - modifyOrder(params: unknown): Promise> { + modifyOrder( + params: USDCPerpModifyOrderRequest + ): Promise> { return this.postPrivate( '/perpetual/usdc/openapi/private/v1/replace-order', params @@ -124,7 +138,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Cancel order */ - cancelOrder(params: unknown): Promise> { + cancelOrder( + params: USDCPerpCancelOrderRequest + ): Promise> { return this.postPrivate( '/perpetual/usdc/openapi/private/v1/cancel-order', params @@ -134,7 +150,7 @@ export class USDCPerpetualClient extends BaseRestClient { /** Cancel all active orders. The real-time response indicates whether the request is successful, depending on retCode. */ cancelActiveOrders( symbol: string, - orderFilter: string + orderFilter: USDCOrderFilter ): Promise> { return this.postPrivate('/perpetual/usdc/openapi/private/v1/cancel-all', { symbol, @@ -143,7 +159,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Query Unfilled/Partially Filled Orders */ - getActiveOrders(params: unknown): Promise> { + getActiveOrders( + params: USDCPerpActiveOrdersRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-active-orders', params @@ -151,7 +169,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Query order history. The endpoint only supports up to 30 days of queried records */ - getHistoricOrders(params: unknown): Promise> { + getHistoricOrders( + params: USDCPerpHistoricOrdersRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-order-history', params @@ -159,7 +179,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Query trade history. The endpoint only supports up to 30 days of queried records. An error will be returned if startTime is more than 30 days. */ - getOrderExecutionHistory(params: unknown): Promise> { + getOrderExecutionHistory( + params: USDCPerpActiveOrdersRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/execution-list', params @@ -169,7 +191,9 @@ export class USDCPerpetualClient extends BaseRestClient { /** -> Account API */ /** The endpoint only supports up to 30 days of queried records. An error will be returned if startTime is more than 30 days. */ - getTransactionLog(params: unknown): Promise> { + getTransactionLog( + params: USDCTransactionLogRequest + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-transaction-log', params @@ -177,10 +201,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Wallet info for USDC account. */ - getBalance(params?: unknown): Promise> { + getBalance(): Promise> { return this.postPrivate( - '/option/usdc/openapi/private/v1/query-wallet-balance', - params + '/option/usdc/openapi/private/v1/query-wallet-balance' ); } @@ -215,7 +238,7 @@ export class USDCPerpetualClient extends BaseRestClient { /** -> Positions API */ /** Query my positions */ - getPositions(params: unknown): Promise> { + getPositions(params: USDCPositionsRequest): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/query-position', params @@ -231,7 +254,9 @@ export class USDCPerpetualClient extends BaseRestClient { } /** Query Settlement History */ - getSettlementHistory(params?: unknown): Promise> { + getSettlementHistory( + params?: USDCSymbolDirectionLimitCursor + ): Promise> { return this.postPrivate( '/option/usdc/openapi/private/v1/session-settlement', params diff --git a/test/usdc/options/public.read.test.ts b/test/usdc/options/public.read.test.ts index c09754b..043e739 100644 --- a/test/usdc/options/public.read.test.ts +++ b/test/usdc/options/public.read.test.ts @@ -36,8 +36,8 @@ describe('Public USDC Options REST API Endpoints', () => { ); }); - it('getLastTrades()', async () => { - expect(await api.getLastTrades({ category: 'OPTION' })).toMatchObject( + it('getLast500Trades()', async () => { + expect(await api.getLast500Trades({ category: 'OPTION' })).toMatchObject( successUSDCResponseObject() ); }); diff --git a/test/usdc/perpetual/private.write.test.ts b/test/usdc/perpetual/private.write.test.ts index f2c11da..ced7af4 100644 --- a/test/usdc/perpetual/private.write.test.ts +++ b/test/usdc/perpetual/private.write.test.ts @@ -41,6 +41,7 @@ describe('Private Account Asset REST API Endpoints', () => { symbol, orderId: 'somethingFake', orderPrice: '20000', + orderFilter: 'Order', }) ).toMatchObject({ retCode: API_ERROR_CODE.ORDER_NOT_FOUND_OR_TOO_LATE,