-
-
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.
pkg/exchange: replace /sapi/v1/margin/transfer to /sapi/v1/asset/tran…
…sfer
- Loading branch information
1 parent
b5cd5aa
commit b6717f2
Showing
8 changed files
with
309 additions
and
444 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,40 @@ | ||
package binanceapi | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/c9s/requestgen" | ||
) | ||
|
||
type TransferResponse struct { | ||
TranId int `json:"tranId"` | ||
} | ||
|
||
type TransferAssetType string | ||
|
||
const ( | ||
TransferAssetTypeMainToMargin TransferAssetType = "MAIN_MARGIN" | ||
TransferAssetTypeMarginToMain TransferAssetType = "MARGIN_MAIN" | ||
TransferAssetTypeMainToIsolatedMargin TransferAssetType = "MAIN_ISOLATED_MARGIN" | ||
TransferAssetTypeIsolatedMarginToMain TransferAssetType = "ISOLATED_MARGIN_MAIN" | ||
) | ||
|
||
//go:generate requestgen -method POST -url "/sapi/v1/asset/transfer" -type TransferAssetRequest -responseType .TransferResponse | ||
type TransferAssetRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
asset string `param:"asset"` | ||
|
||
transferType TransferAssetType `param:"type"` | ||
|
||
amount string `param:"amount"` | ||
|
||
timestamp time.Time `param:"timestamp,milliseconds,query"` | ||
|
||
fromSymbol *string `param:"fromSymbol"` | ||
toSymbol *string `param:"toSymbol"` | ||
} | ||
|
||
func (c *RestClient) NewTransferAssetRequest() *TransferAssetRequest { | ||
return &TransferAssetRequest{client: c} | ||
} |
238 changes: 238 additions & 0 deletions
238
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.
27 changes: 0 additions & 27 deletions
27
pkg/exchange/binance/binanceapi/transfer_cross_margin_account_request.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.