Order
Get user orders in a market
GET /viewer/orders
Parameters
Name | Description | Example | Required |
---|---|---|---|
market_id | market id | ETH-BTC | true |
after | ask for the server to return orders after the cursor | dGVzdGN1cmVzZQo= | false |
before | ask for the server to return orders before the cursor | dGVzdGN1cmVzZQo= | false |
first | slicing count | 20 | false |
last | slicing count | 20 | false |
side | order side | one of "ASK"/"BID" | false |
state | order state | one of "CANCELED"/"FILLED"/"PENDING" | false |
Response is Order collection
{
"edges": [
{
"node": {
"id": 10,
"market_id": "ETH-BTC",
"price": "10.00",
"amount": "10.00",
"filled_amount": "9.0",
"avg_deal_price": "12.0",
"side": "ASK",
"state": "FILLED"
},
"cursor": "dGVzdGN1cmVzZQo="
}
],
"page_info": {
"end_cursor": "dGVzdGN1cmVzZQo=",
"start_cursor": "dGVzdGN1cmVzZQo=",
"has_next_page": true,
"has_previous_page": false
}
}
Get one order
GET /viewer/orders/{order_id}
Parameters
Name | Description | Example | Required |
---|---|---|---|
order_id | id of order | 45 | true |
Response is Order collection
{
"id": 10,
"market_id": "EOS-BTC",
"price": "10.00",
"amount": "10.00",
"filled_amount": "9.0",
"avg_deal_price": "12.0",
"side": "ASK",
"state": "FILLED"
}
Create Order
POST /viewer/orders
Parameters
Name | Description | Example | Require |
---|---|---|---|
market_id | market id | EOS-BTC | true |
side | order side | one of "ASK"/"BID" | true |
price | order price | string | true |
amount | order amount | string, must larger than 0 | true |
Response is an order
{
"id": 10,
"market_id": "EOS-BTC",
"price": "10.00",
"amount": "10.00",
"filled_amount": "9.0",
"avg_deal_price": "12.0",
"side": "ASK",
"state": "FILLED"
}
Cancel Order
POST /viewer/orders/{order_id}/cancel
Parameters
Name | Description | Example | Require |
---|---|---|---|
order_id | id of the order | id1 | true |
Response is an order
{
"id": 10,
"market_id": "EOS-BTC",
"price": "10.00",
"amount": "10.00",
"filled_amount": "9.0",
"avg_deal_price": "12.0",
"side": "ASK",
"state": "FILLED"
}
Cancel All Orders
POST /viewer/orders/cancel_all
Parameters
Name | Description | Example | Require |
---|---|---|---|
market_id | market name | EOS-BTC | true |
Response is the cancelled orders
{
"id": 10,
"market_id": "EOS-BTC",
"price": "10.00",
"amount": "10.00",
"filled_amount": "9.0",
"avg_deal_price": "12.0",
"side": "ASK",
"state": "FILLED"
}