Binance: replace deprecated /v1 API calls (#482)

Several /v1 API calls have been deprecated, and will be removed shortly.
 Moving these across to their /v3 equivalents

Capturing of the klines request via the recorder was failing, as it did
 not handle the structure where the klines response in an array of
 mixed primitive arrays. Excluding primitive values from the exclusion
 checks addresses this
This commit is contained in:
David Ackroyd
2020-04-17 08:59:06 +10:00
committed by GitHub
parent 70cba38fa3
commit c0d2ac5e51
5 changed files with 67154 additions and 44303 deletions

View File

@@ -26,14 +26,14 @@ const (
apiURL = "https://api.binance.com"
// Public endpoints
exchangeInfo = "/api/v1/exchangeInfo"
orderBookDepth = "/api/v1/depth"
recentTrades = "/api/v1/trades"
historicalTrades = "/api/v1/historicalTrades"
aggregatedTrades = "/api/v1/aggTrades"
candleStick = "/api/v1/klines"
exchangeInfo = "/api/v3/exchangeInfo"
orderBookDepth = "/api/v3/depth"
recentTrades = "/api/v3/trades"
historicalTrades = "/api/v3/historicalTrades"
aggregatedTrades = "/api/v3/aggTrades"
candleStick = "/api/v3/klines"
averagePrice = "/api/v3/avgPrice"
priceChange = "/api/v1/ticker/24hr"
priceChange = "/api/v3/ticker/24hr"
symbolPrice = "/api/v3/ticker/price"
bestPrice = "/api/v3/ticker/bookTicker"
accountInfo = "/api/v3/account"

View File

@@ -107,8 +107,6 @@ type RecentTradeRequestParams struct {
// RecentTrade holds recent trade data
type RecentTrade struct {
Code int `json:"code"`
Msg string `json:"msg"`
ID int64 `json:"id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
@@ -247,7 +245,7 @@ type PriceChangeStats struct {
QuoteVolume float64 `json:"quoteVolume,string"`
OpenTime int64 `json:"openTime"`
CloseTime int64 `json:"closeTime"`
FirstID int64 `json:"fristId"`
FirstID int64 `json:"firstId"`
LastID int64 `json:"lastId"`
Count int64 `json:"count"`
}