-
-
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 #1525 from c9s/edwin/binance-update-api-changes-3
FEATURE: [binance] add margin request
- Loading branch information
Showing
6 changed files
with
311 additions
and
42 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
28 changes: 28 additions & 0 deletions
28
pkg/exchange/binance/binanceapi/place_margin_order_request.go
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,28 @@ | ||
package binanceapi | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
|
||
"github.com/c9s/bbgo/pkg/fixedpoint" | ||
) | ||
|
||
//go:generate requestgen -method POST -url "/sapi/v1/margin/borrow-repay" -type PlaceMarginOrderRequest -responseType .TransferResponse | ||
type PlaceMarginOrderRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
asset string `param:"asset"` | ||
|
||
// TRUE for Isolated Margin, FALSE for Cross Margin, Default FALSE | ||
isIsolated bool `param:"isIsolated"` | ||
|
||
// Only for Isolated margin | ||
symbol *string `param:"symbol"` | ||
|
||
amount fixedpoint.Value `param:"amount"` | ||
|
||
BorrowRepayType BorrowRepayType `param:"type"` | ||
} | ||
|
||
func (c *RestClient) NewPlaceMarginOrderRequest() *PlaceMarginOrderRequest { | ||
return &PlaceMarginOrderRequest{client: c} | ||
} |
220 changes: 220 additions & 0 deletions
220
pkg/exchange/binance/binanceapi/place_margin_order_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
18 changes: 1 addition & 17 deletions
18
pkg/exchange/binance/binanceapi/transfer_asset_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.