Skip to content

Commit

Permalink
GateIO: Rename Get*PersonalTradingHistory to GetMy*TradingHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Jan 5, 2025
1 parent acc06b3 commit e0ceb88
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions exchanges/gateio/gateio.go
Original file line number Diff line number Diff line change
Expand Up @@ -2940,8 +2940,8 @@ func (g *Gateio) CancelSingleDeliveryOrder(ctx context.Context, settle currency.
return response, g.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, deliveryCancelOrderEPL, http.MethodDelete, deliveryPath+settle.Item.Lower+"/orders/"+orderID, nil, nil, &response)
}

// GetDeliveryPersonalTradingHistory retrieves personal trading history
func (g *Gateio) GetDeliveryPersonalTradingHistory(ctx context.Context, settle currency.Code, orderID string, contract currency.Pair, limit, offset, countTotal uint64, lastID string) ([]TradingHistoryItem, error) {
// GetMyDeliveryTradingHistory retrieves authenticated account delivery futures trading history
func (g *Gateio) GetMyDeliveryTradingHistory(ctx context.Context, settle currency.Code, orderID string, contract currency.Pair, limit, offset, countTotal uint64, lastID string) ([]TradingHistoryItem, error) {
if settle.IsEmpty() {
return nil, errEmptyOrInvalidSettlementCurrency
}
Expand Down Expand Up @@ -3406,8 +3406,8 @@ func (g *Gateio) CancelOptionSingleOrder(ctx context.Context, orderID string) (*
return response, g.SendAuthenticatedHTTPRequest(ctx, exchange.RestSpot, optionsCancelOrderEPL, http.MethodDelete, "options/orders/"+orderID, nil, nil, &response)
}

// GetOptionsPersonalTradingHistory retrieves personal tradign histories given the underlying{Required}, contract, and other pagination params.
func (g *Gateio) GetOptionsPersonalTradingHistory(ctx context.Context, underlying string, contract currency.Pair, offset, limit uint64, from, to time.Time) ([]OptionTradingHistory, error) {
// GetMyOptionsTradingHistory retrieves authenticated account's option trading history
func (g *Gateio) GetMyOptionsTradingHistory(ctx context.Context, underlying string, contract currency.Pair, offset, limit uint64, from, to time.Time) ([]OptionTradingHistory, error) {
if underlying == "" {
return nil, errInvalidUnderlying
}
Expand Down
13 changes: 7 additions & 6 deletions exchanges/gateio/gateio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1155,11 +1155,11 @@ func TestCancelSingleDeliveryOrder(t *testing.T) {
assert.NoError(t, err, "CancelSingleDeliveryOrder should not error")
}

func TestGetDeliveryPersonalTradingHistory(t *testing.T) {
func TestGetMyDeliveryTradingHistory(t *testing.T) {
t.Parallel()
sharedtestvalues.SkipTestIfCredentialsUnset(t, g)
_, err := g.GetDeliveryPersonalTradingHistory(context.Background(), currency.USDT, "", getPair(t, asset.DeliveryFutures), 0, 0, 1, "")
assert.NoError(t, err, "GetDeliveryPersonalTradingHistory should not error")
_, err := g.GetMyDeliveryTradingHistory(context.Background(), currency.USDT, "", getPair(t, asset.DeliveryFutures), 0, 0, 1, "")
assert.NoError(t, err, "GetMyDeliveryTradingHistory should not error")
}

func TestGetDeliveryPositionCloseHistory(t *testing.T) {
Expand Down Expand Up @@ -1766,11 +1766,12 @@ func TestCancelSingleOrder(t *testing.T) {
}
}

func TestGetOptionsPersonalTradingHistory(t *testing.T) {
func TestGetMyOptionsTradingHistory(t *testing.T) {
t.Parallel()

sharedtestvalues.SkipTestIfCredentialsUnset(t, g)
if _, err := g.GetOptionsPersonalTradingHistory(context.Background(), "BTC_USDT", currency.EMPTYPAIR, 0, 0, time.Time{}, time.Time{}); err != nil {
t.Errorf("%s GetOptionPersonalTradingHistory() error %v", g.Name, err)
if _, err := g.GetMyOptionsTradingHistory(context.Background(), "BTC_USDT", currency.EMPTYPAIR, 0, 0, time.Time{}, time.Time{}); err != nil {
t.Errorf("%s GetMyOptionsTradingHistory() error %v", g.Name, err)
}
}

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 @@ -1878,7 +1878,7 @@ func (g *Gateio) GetOrderHistory(ctx context.Context, req *order.MultiOrderReque
if req.AssetType == asset.Futures {
futuresOrder, err = g.GetMyFuturesTradingHistory(ctx, settle, "", req.FromOrderID, fPair, 0, 0, 0)
} else {
futuresOrder, err = g.GetDeliveryPersonalTradingHistory(ctx, settle, req.FromOrderID, fPair, 0, 0, 0, "")
futuresOrder, err = g.GetMyDeliveryTradingHistory(ctx, settle, req.FromOrderID, fPair, 0, 0, 0, "")
}
if err != nil {
return nil, err
Expand All @@ -1900,8 +1900,7 @@ func (g *Gateio) GetOrderHistory(ctx context.Context, req *order.MultiOrderReque
case asset.Options:
for x := range req.Pairs {
fPair := req.Pairs[x].Format(format)
var optionOrders []OptionTradingHistory
optionOrders, err = g.GetOptionsPersonalTradingHistory(ctx, fPair.String(), fPair.Upper(), 0, 0, req.StartTime, req.EndTime)
optionOrders, err := g.GetMyOptionsTradingHistory(ctx, fPair.String(), fPair.Upper(), 0, 0, req.StartTime, req.EndTime)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e0ceb88

Please sign in to comment.