Skip to content

Commit

Permalink
fix : binance api timestamp error (-1021) when placing an order
Browse files Browse the repository at this point in the history
  • Loading branch information
jessy-bgl committed Aug 18, 2022
1 parent 10d6b9b commit 43921d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class BinanceApiRepository implements IExchangeApiRepository {
side: OrderSidesEnum.BUY,
type: OrderTypesEnum.MARKET,
quoteOrderQty: dca.amount,
recvWindow: 60000,
newOrderRespType: BinanceOrderResponseTypesEnum.FULL,
};
const headers = this.getAuthRequestHeaders(dca.exchange.apiKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ interface IBinanceApiPlaceOrderParams {
type: OrderTypesEnum;
quoteOrderQty: number;
newOrderRespType: BinanceOrderResponseTypesEnum;
recvWindow?: number;
// see more on https://binance-docs.github.io/apidocs/spot/en/#new-order-trade
}

interface IBinanceApiPlacerOrderResult {
symbol: string;
orderId: number;
orderListId: number; //Unless OCO, value will be -1
orderListId: number; // Unless part of an OCO, value will always be -1
clientOrderId: string;
transactTime: number;
price: string;
Expand Down

0 comments on commit 43921d3

Please sign in to comment.