Skip to content

Commit

Permalink
Fix latest trade return value type
Browse files Browse the repository at this point in the history
  • Loading branch information
eynzhang committed Jul 13, 2020
1 parent 948c762 commit 130183a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ For array struct, you can use for/range to iterate each element
```go
// Check the status of response and print some properties
for _, kline := range resp {
applogger.Info("High=%f, Low=%f", kline.High, kline.Low)
applogger.Info("High=%v, Low=%v", kline.High, kline.Low)
}
```

Expand Down
8 changes: 4 additions & 4 deletions cmd/marketclientexample/marketclientexample.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func getCandlestick() {
applogger.Error(err.Error())
} else {
for _, kline := range resp {
applogger.Info("High=%f, Low=%f", kline.High, kline.Low)
applogger.Info("High=%v, Low=%v", kline.High, kline.Low)
}
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ func getLatestTrade() {
applogger.Error(err.Error())
} else {
for _, trade := range resp.Data {
applogger.Info("Id=%d, Price=%f", trade.Id, trade.Price)
applogger.Info("Id=%v, Price=%v", trade.Id, trade.Price)
}
}
}
Expand All @@ -102,7 +102,7 @@ func getHistoricalTrade() {
} else {
for _, tradeData := range resp {
for _, trade := range tradeData.Data {
applogger.Info("price: %f", trade.Price)
applogger.Info("price: %v", trade.Price)
}
}
}
Expand All @@ -116,6 +116,6 @@ func getLast24hCandlestick() {
if err != nil {
applogger.Error(err.Error())
} else {
applogger.Info("Close=%f, Open=%f", resp.Close, resp.Open)
applogger.Info("Close=%v, Open=%v", resp.Close, resp.Open)
}
}
2 changes: 1 addition & 1 deletion pkg/client/orderclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (p *OrderClient) GetHistoryOrders(request *getrequest.GetRequest) (*order.G
return &result, nil
}

// Returns orders based on a specific searching criteria.
// Returns orders based on a specific searching criteria (within 48 hours)
func (p *OrderClient) GetLast48hOrders(request *getrequest.GetRequest) (*order.GetHistoryOrdersResponse, error) {
url := p.privateUrlBuilder.Build("GET", "/v1/order/history", request)
getResp, getErr := internal.HttpGet(url)
Expand Down
2 changes: 1 addition & 1 deletion pkg/response/market/getlatesttraderesponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TradeTick struct {
Amount decimal.Decimal `json:"amount"`
TradeId int64 `json:"trade-id"`
Ts int64 `json:"ts"`
Id int64 `json:"id"`
Id decimal.Decimal `json:"id"`
Price decimal.Decimal `json:"price"`
Direction string `json:"direction"`
}
Expand Down

0 comments on commit 130183a

Please sign in to comment.