Package org.knowm.xchange.binance
Interface BinanceAuthenticated
- All Superinterfaces:
Binance
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaccount
(Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Get current account information.allOrders
(String symbol, Long orderId, Integer limit, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Get all account orders; active, canceled, or filled.assetDetail
(Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Fetch asset details.assetDividend
(String asset, Long startTime, Long endTime, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Fetch small amounts of assets exchanged BNB records.cancelAllOpenOrders
(String symbol, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Cancels all active orders on a symbol.cancelOrder
(String symbol, long orderId, String origClientOrderId, String newClientOrderId, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Cancel an active order.Map<?,
?> closeUserDataStream
(String apiKey, String listenKey) Closes the websocket authenticated connection.depositAddress
(String coin, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Fetch deposit address.depositHistory
(String coin, Long startTime, Long endTime, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Fetch deposit history.getCurrencyInfos
(Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) getDustLog
(Long startTime, Long endTime, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Retrieves the dust log from Binance.Map<?,
?> keepAliveUserDataStream
(String apiKey, String listenKey) Keeps the authenticated websocket session alive.myTrades
(String symbol, Long orderId, Long startTime, Long endTime, Long fromId, Integer limit, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Get trades for a specific account and symbol.newOrder
(String symbol, OrderSide side, OrderType type, TimeInForce timeInForce, BigDecimal quantity, BigDecimal quoteOrderQty, BigDecimal price, String newClientOrderId, BigDecimal stopPrice, Long trailingDelta, BigDecimal icebergQty, BinanceNewOrder.NewOrderResponseType newOrderRespType, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Send in a new orderopenOrders
(String symbol, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Get open orders on a symbol.orderStatus
(String symbol, long orderId, String origClientOrderId, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Check an order's status.
Either orderId or origClientOrderId must be sent.startUserDataStream
(String apiKey) Returns a listen key for websocket login.testNewOrder
(String symbol, OrderSide side, OrderType type, TimeInForce timeInForce, BigDecimal quantity, BigDecimal quoteOrderQty, BigDecimal price, String newClientOrderId, BigDecimal stopPrice, Long trailingDelta, BigDecimal icebergQty, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Test new order creation and signature/recvWindow long.transferHistory
(String fromEmail, Long startTime, Long endTime, Integer page, Integer limit, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) transferSubUserHistory
(String asset, Integer type, Long startTime, Long endTime, Integer limit, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) withdraw
(String coin, String address, String addressTag, BigDecimal amount, String name, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Submit a withdraw request.withdrawHistory
(String coin, Long startTime, Long endTime, Long recvWindow, si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, String apiKey, si.mazi.rescu.ParamsDigest signature) Fetch withdraw history.Methods inherited from interface org.knowm.xchange.binance.Binance
aggTrades, depth, exchangeInfo, klines, ping, systemStatus, ticker24h, ticker24h, tickerAllBookTickers, tickerAllPrices, tickerPrice, time
-
Field Details
-
SIGNATURE
- See Also:
-
X_MBX_APIKEY
- See Also:
-
-
Method Details
-
newOrder
@POST @Path("api/v3/order") BinanceNewOrder newOrder(@FormParam("symbol") String symbol, @FormParam("side") OrderSide side, @FormParam("type") OrderType type, @FormParam("timeInForce") TimeInForce timeInForce, @FormParam("quantity") BigDecimal quantity, @FormParam("quoteOrderQty") BigDecimal quoteOrderQty, @FormParam("price") BigDecimal price, @FormParam("newClientOrderId") String newClientOrderId, @FormParam("stopPrice") BigDecimal stopPrice, @FormParam("trailingDelta") Long trailingDelta, @FormParam("icebergQty") BigDecimal icebergQty, @FormParam("newOrderRespType") BinanceNewOrder.NewOrderResponseType newOrderRespType, @FormParam("recvWindow") Long recvWindow, @FormParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Send in a new order- Parameters:
symbol
-side
-type
-timeInForce
-quantity
-quoteOrderQty
- optionalprice
- optional, must be provided for limit orders onlynewClientOrderId
- optional, a unique id for the order. Automatically generated if not sent.stopPrice
- optional, used with stop orderstrailingDelta
- optional, used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT ordersicebergQty
- optional, used with iceberg ordersnewOrderRespType
- optional, MARKET and LIMIT order types default to FULL, all other orders default to ACKrecvWindow
- optionaltimestamp
-- Returns:
- Throws:
IOException
BinanceException
- See Also:
-
testNewOrder
@POST @Path("api/v3/order/test") Object testNewOrder(@FormParam("symbol") String symbol, @FormParam("side") OrderSide side, @FormParam("type") OrderType type, @FormParam("timeInForce") TimeInForce timeInForce, @FormParam("quantity") BigDecimal quantity, @FormParam("quoteOrderQty") BigDecimal quoteOrderQty, @FormParam("price") BigDecimal price, @FormParam("newClientOrderId") String newClientOrderId, @FormParam("stopPrice") BigDecimal stopPrice, @FormParam("trailingDelta") Long trailingDelta, @FormParam("icebergQty") BigDecimal icebergQty, @FormParam("recvWindow") Long recvWindow, @FormParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.- Parameters:
symbol
-side
-type
-timeInForce
-quantity
-quoteOrderQty
- optionalprice
-newClientOrderId
- optional, a unique id for the order. Automatically generated by default.stopPrice
- optional, used with STOP orderstrailingDelta
- optional, used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT ordersicebergQty
- optional used with icebergOrdersrecvWindow
- optionaltimestamp
-- Returns:
- Throws:
IOException
BinanceException
- See Also:
-
orderStatus
@GET @Path("api/v3/order") BinanceOrder orderStatus(@QueryParam("symbol") String symbol, @QueryParam("orderId") long orderId, @QueryParam("origClientOrderId") String origClientOrderId, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Check an order's status.
Either orderId or origClientOrderId must be sent.- Parameters:
symbol
-orderId
- optionalorigClientOrderId
- optionalrecvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
cancelOrder
@DELETE @Path("api/v3/order") BinanceCancelledOrder cancelOrder(@QueryParam("symbol") String symbol, @QueryParam("orderId") long orderId, @QueryParam("origClientOrderId") String origClientOrderId, @QueryParam("newClientOrderId") String newClientOrderId, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Cancel an active order.- Parameters:
symbol
-orderId
- optionalorigClientOrderId
- optionalnewClientOrderId
- optional, used to uniquely identify this cancel. Automatically generated by default.recvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
cancelAllOpenOrders
@DELETE @Path("api/v3/openOrders") List<BinanceCancelledOrder> cancelAllOpenOrders(@QueryParam("symbol") String symbol, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Cancels all active orders on a symbol. This includes OCO orders.- Parameters:
symbol
-recvWindow
- optionaltimestamp
-- Returns:
- Throws:
IOException
BinanceException
-
openOrders
@GET @Path("api/v3/openOrders") List<BinanceOrder> openOrders(@QueryParam("symbol") String symbol, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Get open orders on a symbol.- Parameters:
symbol
- optionalrecvWindow
- optionaltimestamp
-- Returns:
- Throws:
IOException
BinanceException
-
allOrders
@GET @Path("api/v3/allOrders") List<BinanceOrder> allOrders(@QueryParam("symbol") String symbol, @QueryParam("orderId") Long orderId, @QueryParam("limit") Integer limit, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Get all account orders; active, canceled, or filled.
If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.- Parameters:
symbol
-orderId
- optionallimit
- optionalrecvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
account
@GET @Path("api/v3/account") BinanceAccountInformation account(@QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Get current account information.- Parameters:
recvWindow
- optionaltimestamp
-- Returns:
- Throws:
IOException
BinanceException
-
myTrades
@GET @Path("api/v3/myTrades") List<BinanceTrade> myTrades(@QueryParam("symbol") String symbol, @QueryParam("orderId") Long orderId, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("fromId") Long fromId, @QueryParam("limit") Integer limit, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Get trades for a specific account and symbol.- Parameters:
symbol
-orderId
- optionalstartTime
- optionalendTime
- optionalfromId
- optional, tradeId to fetch from. Default gets most recent trades.limit
- optional, default 500; max 1000.recvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
getDustLog
@GET @Path("/sapi/v1/asset/dribblet") BinanceDustLog getDustLog(@QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Retrieves the dust log from Binance. If you have many currencies with low amount (=dust) that cannot be traded, because their amount is less than the minimum amount required for trading them, you can convert all these currencies at once into BNB with the button "Convert Small Balance to BNB".- Parameters:
startTime
- optional. If set, also the endTime must be set. If neither time is set, the 100 most recent dust logs are returned.endTime
- optional. If set, also the startTime must be set. If neither time is set, the 100 most recent dust logs are returned.recvWindow
- optionaltimestamp
- mandatory- Returns:
- Throws:
IOException
BinanceException
-
getCurrencyInfos
@GET @Path("/sapi/v1/capital/config/getall") List<BinanceCurrencyInfo> getCurrencyInfos(@QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException - Throws:
IOException
BinanceException
-
withdraw
@POST @Path("/sapi/v1/capital/withdraw/apply") WithdrawResponse withdraw(@FormParam("coin") String coin, @FormParam("address") String address, @FormParam("addressTag") String addressTag, @FormParam("amount") BigDecimal amount, @FormParam("name") String name, @FormParam("recvWindow") Long recvWindow, @FormParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Submit a withdraw request.- Parameters:
coin
-address
-addressTag
- optional for Rippleamount
-name
- optional, description of the addressrecvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
depositHistory
@GET @Path("/sapi/v1/capital/deposit/hisrec") List<BinanceDeposit> depositHistory(@QueryParam("coin") String coin, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Fetch deposit history.- Parameters:
coin
- optionalstartTime
- optionalendTime
- optionalrecvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
withdrawHistory
@GET @Path("/sapi/v1/capital/withdraw/history") List<BinanceWithdraw> withdrawHistory(@QueryParam("coin") String coin, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Fetch withdraw history.- Parameters:
coin
- optionalstartTime
- optionalendTime
- optionalrecvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
assetDividend
@GET @Path("/sapi/v1/asset/assetDividend") AssetDividendResponse assetDividend(@QueryParam("asset") String asset, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Fetch small amounts of assets exchanged BNB records.- Parameters:
asset
- optionalstartTime
- optionalendTime
- optionalrecvWindow
- optionaltimestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
transferHistory
@GET @Path("/sapi/v1/sub-account/sub/transfer/history") List<TransferHistory> transferHistory(@QueryParam("fromEmail") String fromEmail, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("page") Integer page, @QueryParam("limit") Integer limit, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException - Throws:
IOException
BinanceException
-
transferSubUserHistory
@GET @Path("/sapi/v1/sub-account/transfer/subUserHistory") List<TransferSubUserHistory> transferSubUserHistory(@QueryParam("asset") String asset, @QueryParam("type") Integer type, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime, @QueryParam("limit") Integer limit, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException - Throws:
IOException
BinanceException
-
depositAddress
@GET @Path("/sapi/v1/capital/deposit/address") DepositAddress depositAddress(@QueryParam("coin") String coin, @QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Fetch deposit address.- Parameters:
coin
-recvWindow
-timestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
assetDetail
@GET @Path("/sapi/v1/asset/assetDetail") Map<String,AssetDetail> assetDetail(@QueryParam("recvWindow") Long recvWindow, @QueryParam("timestamp") si.mazi.rescu.SynchronizedValueFactory<Long> timestamp, @HeaderParam("X-MBX-APIKEY") String apiKey, @QueryParam("signature") si.mazi.rescu.ParamsDigest signature) throws IOException, BinanceException Fetch asset details.- Parameters:
recvWindow
-timestamp
-apiKey
-signature
-- Returns:
- Throws:
IOException
BinanceException
-
startUserDataStream
@POST @Path("/api/v3/userDataStream") BinanceListenKey startUserDataStream(@HeaderParam("X-MBX-APIKEY") String apiKey) throws IOException, BinanceException Returns a listen key for websocket login.- Parameters:
apiKey
- the api key- Returns:
- Throws:
BinanceException
IOException
-
keepAliveUserDataStream
@PUT @Path("/api/v3/userDataStream?listenKey={listenKey}") Map<?,?> keepAliveUserDataStream(@HeaderParam("X-MBX-APIKEY") String apiKey, @PathParam("listenKey") String listenKey) throws IOException, BinanceException Keeps the authenticated websocket session alive.- Parameters:
apiKey
- the api keylistenKey
- the api secret- Returns:
- Throws:
BinanceException
IOException
-
closeUserDataStream
@DELETE @Path("/api/v3/userDataStream?listenKey={listenKey}") Map<?,?> closeUserDataStream(@HeaderParam("X-MBX-APIKEY") String apiKey, @PathParam("listenKey") String listenKey) throws IOException, BinanceException Closes the websocket authenticated connection.- Parameters:
apiKey
- the api keylistenKey
- the api secret- Returns:
- Throws:
BinanceException
IOException
-