UNPKG

binance-futures-wrapper

Version:

A comprehensive TypeScript wrapper for Binance USDT-M Futures API with full REST and WebSocket support

92 lines 2.13 kB
/** * Base types and interfaces for Binance Futures API */ export interface BinanceConfig { apiKey: string; apiSecret: string; testnet?: boolean; baseURL?: string; wsBaseURL?: string; recvWindow?: number; enableLogging?: boolean; } export interface ApiResponse<T = any> { code?: number; msg?: string; data?: T; } export interface RequestOptions { method: 'GET' | 'POST' | 'PUT' | 'DELETE'; endpoint: string; params?: Record<string, any>; signed?: boolean; weight?: number; } export interface OrderSide { BUY: 'BUY'; SELL: 'SELL'; } export interface OrderType { LIMIT: 'LIMIT'; MARKET: 'MARKET'; STOP: 'STOP'; STOP_MARKET: 'STOP_MARKET'; TAKE_PROFIT: 'TAKE_PROFIT'; TAKE_PROFIT_MARKET: 'TAKE_PROFIT_MARKET'; TRAILING_STOP_MARKET: 'TRAILING_STOP_MARKET'; } export interface TimeInForce { GTC: 'GTC'; IOC: 'IOC'; FOK: 'FOK'; GTX: 'GTX'; GTD: 'GTD'; } export interface PositionSide { BOTH: 'BOTH'; LONG: 'LONG'; SHORT: 'SHORT'; } export interface OrderStatus { NEW: 'NEW'; PARTIALLY_FILLED: 'PARTIALLY_FILLED'; FILLED: 'FILLED'; CANCELED: 'CANCELED'; REJECTED: 'REJECTED'; EXPIRED: 'EXPIRED'; } export interface WorkingType { MARK_PRICE: 'MARK_PRICE'; CONTRACT_PRICE: 'CONTRACT_PRICE'; } export interface ResponseType { ACK: 'ACK'; RESULT: 'RESULT'; FULL: 'FULL'; } export interface Interval { '1m': '1m'; '3m': '3m'; '5m': '5m'; '15m': '15m'; '30m': '30m'; '1h': '1h'; '2h': '2h'; '4h': '4h'; '6h': '6h'; '8h': '8h'; '12h': '12h'; '1d': '1d'; '3d': '3d'; '1w': '1w'; '1M': '1M'; } export type OrderSideType = keyof OrderSide; export type OrderTypeType = keyof OrderType; export type TimeInForceType = keyof TimeInForce; export type PositionSideType = keyof PositionSide; export type OrderStatusType = keyof OrderStatus; export type WorkingTypeType = keyof WorkingType; export type ResponseTypeType = keyof ResponseType; export type IntervalType = keyof Interval; //# sourceMappingURL=base.d.ts.map