IlanFrumer / BitMEX-nodejs

An unofficial BitMEX API connector written with typescript
31 stars 15 forks source link

Order.getOrders() #9

Closed irvdev closed 4 years ago

irvdev commented 5 years ago

Hi! I expect only open orders. But I get all the orders

async getOpenedOrders () {
    const orders = await REST.Order.getOrders({ "open": true })
    return orders
}

What am I doing wrong? Thank!

joneszach commented 4 years ago

I signed in to github just to help you out.

I checked the documentation on bitmex AND I re-read the comment in the source code of this project. Notice in the documentation of this project it says to put something in the 'filter' parameter, and that matches what bitmex documentation says.

Get your orders.To get open orders only, send {"open": true} in the filter param

Here's what you need to do:

client.Order.getOrders({ filter: '{"open": true}' })

That will do the trick. I hope it helps and/or is still relevant to you. Can you close this issue?