irufus / gdax-java

Java based wrapper for Coinbase Pro (Formerly known as GDAX API and Coinbase Exchange API)
MIT License
177 stars 131 forks source link

OrderService.getAllFills fails due to API change - Requests without either order_id or product_id will be rejected after 8/23/18. #58

Closed onyxcoyote closed 5 years ago

onyxcoyote commented 5 years ago

error message: ERROR - GET request Failed for '/fills': {"message":"query must contained either product_id or order_id"}

information on the change https://docs.pro.coinbase.com/#fills

onyxcoyote commented 5 years ago

It's not fully baked yet, but something like this seems to work:

public class OrderService {

    public List<Fill> getFillByProductId(FillQuery fillQuery, int resultLimit) {
        return exchange.getAsList(FILLS_ENDPOINT + "?product_id=" + fillQuery.getProduct_id()+"&limit="+resultLimit, new ParameterizedTypeReference<Fill[]>(){});
    }

    public List<Fill> getFillByOrderId(FillQuery fillQuery, int resultLimit) {
        return exchange.getAsList(FILLS_ENDPOINT + "?order_id=" + fillQuery.getOrder_id()+"&limit="+resultLimit, new ParameterizedTypeReference<Fill[]>(){});
    }
irufus commented 5 years ago

Looks like this issue was addressed in your PR that was merged.