-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1312 from MengShue/add_two_new_receiver_for_okex
FEATURE: add QueryClosedOrders() and QueryTrades() for okex
- Loading branch information
Showing
11 changed files
with
684 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package okexapi | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/c9s/requestgen" | ||
) | ||
|
||
//go:generate GetRequest -url "/api/v5/trade/orders-history-archive" -type GetOrderHistoryRequest -responseDataType .APIResponse | ||
type GetOrderHistoryRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
instrumentType InstrumentType `param:"instType,query"` | ||
instrumentID *string `param:"instId,query"` | ||
orderType *OrderType `param:"ordType,query"` | ||
// underlying and instrumentFamil Applicable to FUTURES/SWAP/OPTION | ||
underlying *string `param:"uly,query"` | ||
instrumentFamily *string `param:"instFamily,query"` | ||
|
||
state *OrderState `param:"state,query"` | ||
after *string `param:"after,query"` | ||
before *string `param:"before,query"` | ||
startTime *time.Time `param:"begin,query,milliseconds"` | ||
|
||
// endTime for each request, startTime and endTime can be any interval, but should be in last 3 months | ||
endTime *time.Time `param:"end,query,milliseconds"` | ||
|
||
// limit for data size per page. Default: 100 | ||
limit *uint64 `param:"limit,query"` | ||
} | ||
|
||
type OrderList []OrderDetails | ||
|
||
// NewGetOrderHistoriesRequest is descending order by createdTime | ||
func (c *RestClient) NewGetOrderHistoryRequest() *GetOrderHistoryRequest { | ||
return &GetOrderHistoryRequest{ | ||
client: c, | ||
instrumentType: InstrumentTypeSpot, | ||
} | ||
} |
Oops, something went wrong.