-
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
okexapi: add /api/v5/account/account-position-risk api
- Loading branch information
Showing
5 changed files
with
317 additions
and
2 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
43 changes: 43 additions & 0 deletions
43
pkg/exchange/okex/okexapi/get_account_position_risk_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,43 @@ | ||
package okexapi | ||
|
||
import ( | ||
"github.com/c9s/requestgen" | ||
) | ||
|
||
//go:generate -command GetRequest requestgen -method GET -responseType .APIResponse -responseDataField Data | ||
//go:generate -command PostRequest requestgen -method POST -responseType .APIResponse -responseDataField Data | ||
|
||
type PositionRiskResponse struct { | ||
AdjEq string `json:"adjEq"` | ||
BalData []struct { | ||
Ccy string `json:"ccy"` | ||
DisEq string `json:"disEq"` | ||
Eq string `json:"eq"` | ||
} `json:"balData"` | ||
PosData []struct { | ||
BaseBal string `json:"baseBal"` | ||
Ccy string `json:"ccy"` | ||
InstId string `json:"instId"` | ||
InstType string `json:"instType"` | ||
MgnMode string `json:"mgnMode"` | ||
NotionalCcy string `json:"notionalCcy"` | ||
NotionalUsd string `json:"notionalUsd"` | ||
Pos string `json:"pos"` | ||
PosCcy string `json:"posCcy"` | ||
PosId string `json:"posId"` | ||
PosSide string `json:"posSide"` | ||
QuoteBal string `json:"quoteBal"` | ||
} `json:"posData"` | ||
Ts string `json:"ts"` | ||
} | ||
|
||
//go:generate GetRequest -url "/api/v5/account/account-position-risk" -type GetAccountPositionRiskRequest -responseDataType []PositionRiskResponse | ||
type GetAccountPositionRiskRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
} | ||
|
||
func (c *RestClient) NewGetAccountPositionRiskRequest() *GetAccountPositionRiskRequest { | ||
return &GetAccountPositionRiskRequest{ | ||
client: c, | ||
} | ||
} |
171 changes: 171 additions & 0 deletions
171
pkg/exchange/okex/okexapi/get_account_position_risk_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
87 changes: 85 additions & 2 deletions
87
pkg/exchange/okex/okexapi/get_account_spot_borrow_repay_history_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.