irufus / gdax-java

Java based wrapper for Coinbase Pro (Formerly known as GDAX API and Coinbase Exchange API)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

onyxcoyote opened this issue · comments

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

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[]>(){});
    }

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