spot v3 request types

This commit is contained in:
tiagosiebler
2022-09-10 12:33:51 +01:00
parent 3a984594dc
commit c287495052
5 changed files with 121 additions and 44 deletions

View File

@@ -1,4 +1,3 @@
export * from './response';
export * from './request';
export * from './shared';
export * from './spot';

View File

@@ -1,5 +1,6 @@
export * from './account-asset';
export * from './copy-trading';
export * from './spot';
export * from './usdt-perp';
export * from './usdc-perp';
export * from './usdc-options';

81
src/types/request/spot.ts Normal file
View File

@@ -0,0 +1,81 @@
import { numberInString, OrderSide } from '../shared';
export type OrderTypeSpot = 'LIMIT' | 'MARKET' | 'LIMIT_MAKER';
export type OrderTimeInForce = 'GTC' | 'FOK' | 'IOC';
export interface NewSpotOrder {
symbol: string;
qty: number;
side: OrderSide;
type: OrderTypeSpot;
timeInForce?: OrderTimeInForce;
price?: number;
orderLinkId?: string;
}
export interface NewSpotOrderV3 {
symbol: string;
orderQty: string;
side: OrderSide;
orderType: OrderTypeSpot;
timeInForce?: OrderTimeInForce;
orderPrice?: string;
orderLinkId?: string;
orderCategory?: 0 | 1;
triggerPrice?: string;
}
export interface SpotOrderQueryById {
orderId?: string;
orderLinkId?: string;
}
export interface SpotSymbolInfo {
name: string;
alias: string;
baseCurrency: string;
quoteCurrency: string;
basePrecision: numberInString;
quotePrecision: numberInString;
minTradeQuantity: numberInString;
minTradeAmount: numberInString;
minPricePrecision: numberInString;
maxTradeQuantity: numberInString;
maxTradeAmount: numberInString;
category: numberInString;
}
export interface SpotMyTradesRequest {
symbol?: string;
orderId?: string;
limit?: string;
startTime?: number;
endTime?: number;
fromTradeId?: string;
toTradeId?: string;
}
export interface SpotLeveragedTokenPRHistoryRequest {
ltCode?: string;
orderId?: string;
startTime?: number;
endTime?: number;
limit?: number;
orderType?: 1 | 2;
serialNo?: string;
}
export interface SpotCrossMarginBorrowingInfoRequest {
startTime?: number;
endTime?: number;
coin?: string;
status?: 0 | 1 | 2;
limit?: number;
}
export interface SpotCrossMarginRepaymentHistoryRequest {
startTime?: number;
endTime?: number;
coin?: string;
limit?: number;
}

View File

@@ -1,34 +0,0 @@
import { numberInString, OrderSide } from './shared';
export type OrderTypeSpot = 'LIMIT' | 'MARKET' | 'LIMIT_MAKER';
export type OrderTimeInForce = 'GTC' | 'FOK' | 'IOC';
export interface NewSpotOrder {
symbol: string;
qty: number;
side: OrderSide;
type: OrderTypeSpot;
timeInForce?: OrderTimeInForce;
price?: number;
orderLinkId?: string;
}
export interface SpotOrderQueryById {
orderId?: string;
orderLinkId?: string;
}
export interface SpotSymbolInfo {
name: string;
alias: string;
baseCurrency: string;
quoteCurrency: string;
basePrecision: numberInString;
quotePrecision: numberInString;
minTradeQuantity: numberInString;
minTradeAmount: numberInString;
minPricePrecision: numberInString;
maxTradeQuantity: numberInString;
maxTradeAmount: numberInString;
category: numberInString;
}