-
-
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 #1760 from c9s/chiahung/max/query-depth
FEATURE: [max] add QueryDepth v3 API to query orderbook
- Loading branch information
Showing
4 changed files
with
271 additions
and
0 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,29 @@ | ||
package v3 | ||
|
||
//go:generate -command GetRequest requestgen -method GET | ||
|
||
import ( | ||
"github.com/c9s/bbgo/pkg/fixedpoint" | ||
"github.com/c9s/requestgen" | ||
) | ||
|
||
type Depth struct { | ||
Timestamp int64 `json:"timestamp"` | ||
LastUpdateVersion int64 `json:"last_update_version"` | ||
LastUpdateId int64 `json:"last_update_id"` | ||
Bids [][]fixedpoint.Value `json:"bids"` | ||
Asks [][]fixedpoint.Value `json:"asks"` | ||
} | ||
|
||
//go:generate GetRequest -url "/api/v3/depth" -type GetDepthRequest -responseType Depth | ||
type GetDepthRequest struct { | ||
client requestgen.APIClient | ||
|
||
market string `param:"market,required"` | ||
limit *int `param:"limit"` | ||
sortByPrice *bool `param:"sort_by_price"` | ||
} | ||
|
||
func (s *Client) NewGetDepthRequest() *GetDepthRequest { | ||
return &GetDepthRequest{client: s.Client} | ||
} |
212 changes: 212 additions & 0 deletions
212
pkg/exchange/max/maxapi/v3/get_depth_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.