USDC request param typings

This commit is contained in:
tiagosiebler
2022-09-08 18:24:18 +01:00
parent 5187350878
commit 557ddc90f5
8 changed files with 382 additions and 58 deletions

View File

@@ -1,3 +1,5 @@
export * from './account-asset';
export * from './usdt-perp';
export * from './usdc-perp';
export * from './usdc-options';
export * from './usdc-shared';

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}