okex: parse numbers as fixedpoints

This commit is contained in:
c9s 2021-05-23 13:45:17 +08:00
parent 8842208441
commit b1aadb4bf0

View File

@ -118,18 +118,18 @@ func (c *RestClient) newAuthenticatedRequest(method, refURL string, params url.V
type BalanceDetail struct {
Currency string `json:"ccy"`
Available string `json:"availEq"`
CashBalance string `json:"cashBal"`
OrderFrozen string `json:"ordFrozen"`
Frozen string `json:"frozenBal"`
Equity string `json:"eq"`
EquityInUSD string `json:"eqUsd"`
UpdateTime string `json:"uTime"`
UnrealizedProfitAndLoss string `json:"upl"`
Available fixedpoint.Value `json:"availEq"`
CashBalance fixedpoint.Value `json:"cashBal"`
OrderFrozen fixedpoint.Value `json:"ordFrozen"`
Frozen fixedpoint.Value `json:"frozenBal"`
Equity fixedpoint.Value `json:"eq"`
EquityInUSD fixedpoint.Value `json:"eqUsd"`
UpdateTime types.MillisecondTimestamp `json:"uTime"`
UnrealizedProfitAndLoss fixedpoint.Value `json:"upl"`
}
type BalanceSummary struct {
TotalEquityInUSD string `json:"totalEq"`
TotalEquityInUSD fixedpoint.Value `json:"totalEq"`
UpdateTime string `json:"uTime"`
Details []BalanceDetail `json:"details"`
}
@ -161,9 +161,9 @@ func (c *RestClient) AccountBalances() (BalanceSummaryList, error) {
type AssetBalance struct {
Currency string `json:"ccy"`
Balance string `json:"bal"`
Frozen string `json:"frozenBal,omitempty"`
Available string `json:"availBal,omitempty"`
Balance fixedpoint.Value `json:"bal"`
Frozen fixedpoint.Value `json:"frozenBal,omitempty"`
Available fixedpoint.Value `json:"availBal,omitempty"`
}
type AssetBalanceList []AssetBalance
@ -198,9 +198,9 @@ type AssetCurrency struct {
CanDeposit bool `json:"canDep"`
CanWithdraw bool `json:"canWd"`
CanInternal bool `json:"canInternal"`
MinWithdrawalFee string `json:"minFee"`
MaxWithdrawalFee string `json:"maxFee"`
MinWithdrawalThreshold string `json:"minWd"`
MinWithdrawalFee fixedpoint.Value `json:"minFee"`
MaxWithdrawalFee fixedpoint.Value `json:"maxFee"`
MinWithdrawalThreshold fixedpoint.Value `json:"minWd"`
}
func (c *RestClient) AssetCurrencies() ([]AssetCurrency, error) {