Skip to content

Commit

Permalink
GateIO: Remove duplicate DeliveryTradingHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Jan 5, 2025
1 parent ad954a6 commit acc06b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
4 changes: 2 additions & 2 deletions exchanges/gateio/gateio.go
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,7 @@ func (g *Gateio) GetDeliveryOrderbook(ctx context.Context, settle currency.Code,
}

// GetDeliveryTradingHistory retrieves futures trading history
func (g *Gateio) GetDeliveryTradingHistory(ctx context.Context, settle currency.Code, lastID string, contract currency.Pair, limit uint64, from, to time.Time) ([]DeliveryTradingHistory, error) {
func (g *Gateio) GetDeliveryTradingHistory(ctx context.Context, settle currency.Code, lastID string, contract currency.Pair, limit uint64, from, to time.Time) ([]TradingHistoryItem, error) {
if settle.IsEmpty() {
return nil, errEmptyOrInvalidSettlementCurrency
}
Expand All @@ -2676,7 +2676,7 @@ func (g *Gateio) GetDeliveryTradingHistory(ctx context.Context, settle currency.
if lastID != "" {
params.Set("last_id", lastID)
}
var histories []DeliveryTradingHistory
var histories []TradingHistoryItem
return histories, g.SendHTTPRequest(ctx, exchange.RestSpot, publicTradingHistoryDeliveryEPL, common.EncodeURLValues(deliveryPath+settle.Item.Lower+"/trades", params), &histories)
}

Expand Down
9 changes: 0 additions & 9 deletions exchanges/gateio/gateio_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,15 +836,6 @@ type DeliveryContract struct {
InDelisting bool `json:"in_delisting"`
}

// DeliveryTradingHistory represents futures trading history
type DeliveryTradingHistory struct {
ID int64 `json:"id"`
CreateTime types.Time `json:"create_time"`
Contract string `json:"contract"`
Size float64 `json:"size"`
Price types.Number `json:"price"`
}

// OptionUnderlying represents option underlying and it's index price.
type OptionUnderlying struct {
Name string `json:"name"`
Expand Down
5 changes: 2 additions & 3 deletions exchanges/gateio/gateio_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,7 @@ func (g *Gateio) GetRecentTrades(ctx context.Context, p currency.Pair, a asset.I
if err != nil {
return nil, err
}
var deliveryTrades []DeliveryTradingHistory
deliveryTrades, err = g.GetDeliveryTradingHistory(ctx, settle, "", p.Upper(), 0, time.Time{}, time.Time{})
deliveryTrades, err := g.GetDeliveryTradingHistory(ctx, settle, "", p.Upper(), 0, time.Time{}, time.Time{})
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1875,7 +1874,7 @@ func (g *Gateio) GetOrderHistory(ctx context.Context, req *order.MultiOrderReque
if err != nil {
return nil, err
}
var futuresOrder []TradingHistoryItem
var futuresOrder []TradingHistoryItem
if req.AssetType == asset.Futures {
futuresOrder, err = g.GetMyFuturesTradingHistory(ctx, settle, "", req.FromOrderID, fPair, 0, 0, 0)
} else {
Expand Down

0 comments on commit acc06b3

Please sign in to comment.