From e17dd7dc9257c3666275bd5abb432cab4e12d81a Mon Sep 17 00:00:00 2001 From: hirokisan Date: Wed, 25 Sep 2024 21:46:55 +0900 Subject: [PATCH] fix: /v5/account/fee-rate (#184) * fix: tag * docs: /v5/account/fee-rate * chore: cosme * docs: ws trade v5 * chore: delete unused --- README.md | 6 ++++++ v5_account_service.go | 9 +++++---- v5_ws_trade.go | 8 -------- v5_ws_trade_order.go | 8 +++----- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e322395..8fbe06f 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ The following API endpoints have been implemented - [`/v5/account/transaction-log` Get Transaction Log](https://bybit-exchange.github.io/docs/v5/account/transaction-log) - [`/v5/account/collateral-info` Get Collateral Info](https://bybit-exchange.github.io/docs/v5/account/collateral-info) - [`/v5/account/set-collateral-switch` Set Collateral Coin](https://bybit-exchange.github.io/docs/v5/account/set-collateral) +- [`/v5/account/fee-rate` Get Fee Rate](https://bybit-exchange.github.io/docs/v5/account/fee-rate) #### Asset @@ -361,6 +362,11 @@ The following API endpoints have been implemented - [Wallet](https://bybit-exchange.github.io/docs/v5/websocket/private/wallet) - [Execution](https://bybit-exchange.github.io/docs/v5/websocket/private/execution) +#### [Trade V5](https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline) + +- Create +- Cancel + #### [Spot v1](https://bybit-exchange.github.io/docs/spot/v1/#t-websocket) ##### Public Topics diff --git a/v5_account_service.go b/v5_account_service.go index 21f03cc..ea2f156 100644 --- a/v5_account_service.go +++ b/v5_account_service.go @@ -281,9 +281,10 @@ func (s *V5AccountService) GetTransactionLog(param V5GetTransactionLogParam) (*V // V5GetFeeRateParam : type V5GetFeeRateParam struct { - Category CategoryV5 `json:"category"` - Symbol SymbolV5 `json:"symbol"` - BaseCoin *Coin `url:"baseCoin,omitempty"` + Category CategoryV5 `url:"category"` + + Symbol *SymbolV5 `url:"symbol,omitempty"` + BaseCoin *Coin `url:"baseCoin,omitempty"` } // V5GetFeeRateResponse : @@ -304,7 +305,7 @@ type V5GetFeeRateList []V5GetFeeRateItem // V5GetFeeRateItem : type V5GetFeeRateItem struct { Symbol SymbolV5 `json:"symbol"` - BaseCoin *Coin `url:"baseCoin,omitempty"` + BaseCoin Coin `json:"baseCoin"` TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` } diff --git a/v5_ws_trade.go b/v5_ws_trade.go index 24747d4..4d0d2bc 100644 --- a/v5_ws_trade.go +++ b/v5_ws_trade.go @@ -64,14 +64,6 @@ func (s *V5WebsocketTradeService) judgeTopic(respBody []byte) (V5WebsocketTradeT return "", nil } -// parseResponse : -func (s *V5WebsocketTradeService) parseResponse(respBody []byte, response interface{}) error { - if err := json.Unmarshal(respBody, &response); err != nil { - return err - } - return nil -} - // Login : Apply for authentication when establishing a connection. func (s *V5WebsocketTradeService) Login() error { param, err := s.client.buildAuthParam() diff --git a/v5_ws_trade_order.go b/v5_ws_trade_order.go index da3e96c..432f1d2 100644 --- a/v5_ws_trade_order.go +++ b/v5_ws_trade_order.go @@ -2,11 +2,11 @@ package bybit import ( "encoding/json" - "fmt" - "github.com/google/uuid" - "github.com/gorilla/websocket" "strconv" "time" + + "github.com/google/uuid" + "github.com/gorilla/websocket" ) // CreateOrder : @@ -29,7 +29,6 @@ func (s *V5WebsocketTradeService) CreateOrder(orders []*V5CreateOrderParam) erro } buf, err := json.Marshal(param) if err != nil { - fmt.Printf("error is %+v", err) return err } @@ -58,7 +57,6 @@ func (s *V5WebsocketTradeService) CancelOrder(orders []*V5CancelOrderParam) erro } buf, err := json.Marshal(param) if err != nil { - fmt.Printf("error is %+v", err) return err }