-
-
Notifications
You must be signed in to change notification settings - Fork 293
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 #1528 from c9s/c9s/rewrite-binance-depth-requestgen
REFACTOR: [binance] rewrite binance depth requestgen
- Loading branch information
Showing
7 changed files
with
390 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package binanceapi | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
|
||
"github.com/c9s/bbgo/pkg/fixedpoint" | ||
) | ||
|
||
type Depth struct { | ||
LastUpdateId int64 `json:"lastUpdateId"` | ||
Bids [][]fixedpoint.Value `json:"bids"` | ||
Asks [][]fixedpoint.Value `json:"asks"` | ||
} | ||
|
||
//go:generate requestgen -method GET -url "/api/v3/depth" -type GetDepthRequest -responseType .Depth | ||
type GetDepthRequest struct { | ||
client requestgen.APIClient | ||
|
||
symbol string `param:"symbol"` | ||
limit int `param:"limit" defaultValue:"1000"` | ||
} | ||
|
||
func (c *RestClient) NewGetDepthRequest() *GetDepthRequest { | ||
return &GetDepthRequest{client: c} | ||
} |
190 changes: 190 additions & 0 deletions
190
pkg/exchange/binance/binanceapi/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.
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
Oops, something went wrong.