-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper types for futuresExchangeInfo #649
base: master
Are you sure you want to change the base?
Changes from 3 commits
973952b
fc8631b
6e444ff
11381b7
7ced505
ebb1984
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
node_modules/ | ||
.nyc_output/ | ||
dist/ | ||
|
||
.vscode/ | ||
.yarn/ | ||
.yarnrc | ||
.env | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -610,7 +610,7 @@ declare module 'binance-api-node' { | |
): Promise<UniversalTransferHistoryResponse> | ||
futuresPing(): Promise<boolean> | ||
futuresTime(): Promise<number> | ||
futuresExchangeInfo(): Promise<ExchangeInfo<FuturesOrderType_LT>> | ||
futuresExchangeInfo(): Promise<FuturesExchangeInfo> | ||
futuresBook(options: { symbol: string; limit?: number }): Promise<OrderBook> | ||
futuresCandles(options: CandlesOptions): Promise<CandleChartResult[]> | ||
futuresMarkPriceCandles(options: CandlesOptions): Promise<CandleChartResult[]> | ||
|
@@ -1036,7 +1036,7 @@ declare module 'binance-api-node' { | |
|
||
export interface SymbolMinNotionalFilter { | ||
filterType: SymbolFilterType.MIN_NOTIONAL | ||
notional: string | ||
minNotional: string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bennycode what's the consensus on this one? Pretty sure there's a lot of back and forth on this which might be due to the fact the field changes depending on which endpoint is hit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yepp, that's why there is now a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh actually you were part of the original convo, my bad There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha thank you for the confirmation |
||
} | ||
|
||
export interface SymbolMaxNumOrdersFilter { | ||
|
@@ -1094,6 +1094,73 @@ declare module 'binance-api-node' { | |
bids: Bid[] | ||
} | ||
|
||
export interface FuturesSymbolMinNotionalFilter { | ||
filterType: SymbolFilterType.MIN_NOTIONAL | ||
notional: string | ||
} | ||
|
||
export interface FuturesSymbolMaxNumOrdersFilter { | ||
filterType: SymbolFilterType.MAX_NUM_ORDERS | ||
limit: number | ||
} | ||
|
||
export interface FuturesSymbolMaxAlgoOrdersFilter { | ||
filterType: SymbolFilterType.MAX_ALGO_ORDERS | ||
limit: number | ||
} | ||
|
||
export type FuturesSymbolFilter = | ||
| SymbolPriceFilter | ||
| SymbolLotSizeFilter | ||
| SymbolMarketLotSizeFilter | ||
| FuturesSymbolMaxNumOrdersFilter | ||
| FuturesSymbolMaxAlgoOrdersFilter | ||
| SymbolPercentPriceFilter | ||
| FuturesSymbolMinNotionalFilter | ||
|
||
export interface FuturesSymbol { | ||
baseAsset: string | ||
baseAssetPrecision: number | ||
contractType: FuturesContractType, | ||
deliveryDate: number | ||
filters: FuturesSymbolFilter[], | ||
liquidationFee: string | ||
maintMarginPercent: string | ||
marginAsset: string | ||
marketTakeBound: string | ||
maxMoveOrderLimit: number | ||
onboardDate: number | ||
orderTypes: FuturesOrderType_LT | ||
pair: string | ||
pricePrecision: number | ||
quantityPrecision: number | ||
quoteAsset: string | ||
quotePrecision: number | ||
requiredMarginPercent: string | ||
settlePlan: number | ||
status: FuturesContractStatus | ||
symbol: string | ||
timeInForce: FuturesTimeInForce | ||
triggerProtect: string | ||
underlyingType: string | ||
underlyingSubType: string[] | ||
} | ||
|
||
export interface FuturesAsset_EI { | ||
asset: string | ||
marginAvailable: boolean | ||
autoAssetExchange: string | ||
} | ||
|
||
export interface FuturesExchangeInfo { | ||
timezone: string | ||
serverTime: number | ||
rateLimits: ExchangeInfoRateLimit[] | ||
exchangeFilters: ExchangeFilter[] | ||
assets: FuturesAsset_EI[] | ||
symbols: FuturesSymbol[] | ||
} | ||
|
||
interface NewFuturesOrderBase { | ||
symbol: string | ||
side: OrderSide_LT | ||
|
@@ -1401,6 +1468,25 @@ declare module 'binance-api-node' { | |
TRAILING_STOP_MARKET = 'TRAILING_STOP_MARKET', | ||
} | ||
|
||
export type FuturesContractType = | ||
| 'PERPETUAL' | ||
| 'CURRENT_MONTH' | ||
| 'NEXT_MONTH' | ||
| 'CURRENT_QUARTER' | ||
| 'NEXT_QUARTER' | ||
| 'PERPETUAL_DELIVERING' | ||
|
||
export type FuturesContractStatus = | ||
| 'PENDING_TRADING' | ||
| 'TRADING' | ||
| 'PRE_DELIVERING' | ||
| 'DELIVERING' | ||
| 'DELIVERED' | ||
| 'PRE_SETTLE' | ||
| 'SETTLING' | ||
| 'CLOSE' | ||
|
||
|
||
export type NewOrderRespType_LT = 'ACK' | 'RESULT' | 'FULL' | ||
|
||
export const enum NewOrderRespType { | ||
|
@@ -1411,6 +1497,8 @@ declare module 'binance-api-node' { | |
|
||
export type TimeInForce_LT = 'GTC' | 'IOC' | 'FOK' | 'GTE_GTC' | ||
|
||
export type FuturesTimeInForce = 'GTC' | 'IOC' | 'FOK' | 'GTX' | 'GTD' | ||
|
||
export const enum TimeInForce { | ||
GTC = 'GTC', | ||
IOC = 'IOC', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(all changes of gitignore)