From c541c26f5c1aa0e733838b707757128c843cf7a5 Mon Sep 17 00:00:00 2001 From: dwd Date: Wed, 18 Sep 2024 21:00:58 +0800 Subject: [PATCH] fix func: bnc.QuerySpotTrades bnc.QuerySpotAggTrades --- bnc/config_pub.go | 6 +++--- bnc/public_test.go | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bnc/config_pub.go b/bnc/config_pub.go index ad58206..653ff6b 100644 --- a/bnc/config_pub.go +++ b/bnc/config_pub.go @@ -402,7 +402,7 @@ type SpotTrade struct { Price float64 `json:"price,string"` Qty float64 `json:"qty,string"` QuoteQty float64 `json:"quoteQty,string"` - Time int64 `json:"time,string"` + Time int64 `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` IsBestMatch bool `json:"isBestMatch"` } @@ -429,8 +429,8 @@ type SpotAggTrades struct { Id int64 `json:"a"` Price float64 `json:"p,string"` Qty float64 `json:"q,string"` - FirstTradeId int64 `json:"f,string"` - LastTradeId int64 `json:"l,string"` + FirstTradeId int64 `json:"f"` + LastTradeId int64 `json:"l"` Time int64 `json:"T"` IsBuyerMaker bool `json:"m"` IsBestMatch bool `json:"M"` diff --git a/bnc/public_test.go b/bnc/public_test.go index fb17db3..707cc8c 100644 --- a/bnc/public_test.go +++ b/bnc/public_test.go @@ -166,3 +166,11 @@ func TestQueryFuturesPrices(t *testing.T) { func TestQueryCMPremiumIndex(t *testing.T) { publicTestChecker(QueryCMPremiumIndex("", "BTCUSD")) } + +func TestQuerySpotTrades(t *testing.T) { + publicTestChecker(QuerySpotTrades("ETHUSDT")) +} + +func TestQuerySpotAggTrades(t *testing.T) { + publicTestChecker(QuerySpotAggTrades("ETHUSDT")) +}