-
-
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.
Revert "pkg/exchange: replace /sapi/v1/margin/transfer to /sapi/v1/as…
…set/transfer" This reverts commit b6717f2.
- Loading branch information
1 parent
d34a410
commit a351203
Showing
7 changed files
with
292 additions
and
135 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 was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
pkg/exchange/binance/binanceapi/transfer_cross_margin_account_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,27 @@ | ||
package binanceapi | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
) | ||
|
||
type TransferResponse struct { | ||
TranId int `json:"tranId"` | ||
} | ||
|
||
//go:generate requestgen -method POST -url "/sapi/v1/margin/transfer" -type TransferCrossMarginAccountRequest -responseType .TransferResponse | ||
type TransferCrossMarginAccountRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
asset string `param:"asset"` | ||
|
||
// transferType: | ||
// 1: transfer from main account to cross margin account | ||
// 2: transfer from cross margin account to main account | ||
transferType int `param:"type"` | ||
|
||
amount string `param:"amount"` | ||
} | ||
|
||
func (c *RestClient) NewTransferCrossMarginAccountRequest() *TransferCrossMarginAccountRequest { | ||
return &TransferCrossMarginAccountRequest{client: c} | ||
} |
85 changes: 15 additions & 70 deletions
85
...eapi/transfer_asset_request_requestgen.go → ...ross_margin_account_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
pkg/exchange/binance/binanceapi/transfer_isolated_margin_account_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,32 @@ | ||
package binanceapi | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
) | ||
|
||
type AccountType string | ||
|
||
const ( | ||
AccountTypeSpot AccountType = "SPOT" | ||
AccountTypeIsolatedMargin AccountType = "ISOLATED_MARGIN" | ||
) | ||
|
||
//go:generate requestgen -method POST -url "/sapi/v1/margin/isolated/transfer" -type TransferIsolatedMarginAccountRequest -responseType .TransferResponse | ||
type TransferIsolatedMarginAccountRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
asset string `param:"asset"` | ||
symbol string `param:"symbol"` | ||
|
||
// transFrom: "SPOT", "ISOLATED_MARGIN" | ||
transFrom AccountType `param:"transFrom"` | ||
|
||
// transTo: "SPOT", "ISOLATED_MARGIN" | ||
transTo AccountType `param:"transTo"` | ||
|
||
amount string `param:"amount"` | ||
} | ||
|
||
func (c *RestClient) NewTransferIsolatedMarginAccountRequest() *TransferIsolatedMarginAccountRequest { | ||
return &TransferIsolatedMarginAccountRequest{client: c} | ||
} |
Oops, something went wrong.