webcerebrium / java-binance-api

Java Binance API Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The method cancelOrder(BinanceOrder) is undefined for the type BinanceOrder

spapapan opened this issue · comments

I am trying to cancel an order using the example code:

BinanceSymbol symbol = new BinanceSymbol("ETHBTC");
BinanceOrder order = api.getOrder(symbol, 123456L);
System.out.println(order.cancelOrder(order));

But I get the error:

The method cancelOrder(BinanceOrder) is undefined for the type BinanceOrder

Also there is no method
getOrder
but
getOrderById

@spapapan please use deleteOrder instead of cancelOrder. Seems to be a mislead in the README

Also there is no method
getOrder
but
getOrderById

There is actually a method getOrder but it accepts BinanceOrder as the only parameter. It is used when you've just created the order and have that object from its result.

If you just have symbol and order ID, then yes, getOrderById should be used.

Thanks, that worked.

Also, is not

order.deleteOrder(order);

but

BinanceApi api = new BinanceApi();
api.deleterOrder(order);