mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
GateIO: Fix GetFuturesContractDetails for delivery futures and minor other fixes (#1766)
* GateIO: Fix GetFuturesContractDetails for Deliveries Was returning the product of all the contracts, so 1444 instead of 38 contracts. * GateIO: Fix GetOpenInterest returning asset.ErrNotEnabled Using wrong error for pair not enabled * GateIO: Rename GetSingleContract and GetSingleDeliveryContracts Especially fixes GetSingleContract, which seems misleading to not say Futures. There's a load of `GetSingle*` here that should probably also be fixed, but these two justified a dyno * GateIO: Rename GateIOGetPersonalTradingHistory to GetMySpotTradingHistory * GateIO: Rename GetMyPersonalTradingHistory to GetMyFuturesTradingHistory * GateIO: Remove duplicate DeliveryTradingHistory * GateIO: Rename Get*PersonalTradingHistory to GetMy*TradingHistory * Linter: Disable shadow linting for err It's been a year, and I'm still getting caught out by govet demanding I don't shadow a var I was deliberately shadowing. Made worse by an increase in clashes with stylecheck when they both want opposite things on the same line. * GateIO: Add missing Futures and tradinghistory fields * GateIO: Improve WS Header parsing This unifies handling for time_ms and time in response headers, since options and delivery have only time, but spot has time_ms as well. We use the better of the two results. Also [improves performance 2x](https://gist.github.com/gbjk/7cacb63b9a256e745534bb05ca853c48) * GateIO: Use time_ms WS fields where available Removes the deprecated _time json fields and populates our Time fields with the time_ms values
This commit is contained in:
@@ -79,7 +79,6 @@ var (
|
||||
errGRPCShutdownSignalIsNil = errors.New("cannot shutdown, gRPC shutdown channel is nil")
|
||||
errInvalidStrategy = errors.New("invalid strategy")
|
||||
errSpecificPairNotEnabled = errors.New("specified pair is not enabled")
|
||||
errPairNotEnabled = errors.New("pair is not enabled")
|
||||
)
|
||||
|
||||
// RPCServer struct
|
||||
@@ -4723,7 +4722,7 @@ func (s *RPCServer) GetFundingRates(ctx context.Context, r *gctrpc.GetFundingRat
|
||||
}
|
||||
|
||||
if !pairs.Contains(cp, true) {
|
||||
return nil, fmt.Errorf("%w %v", errPairNotEnabled, cp)
|
||||
return nil, fmt.Errorf("%w %v", currency.ErrPairNotEnabled, cp)
|
||||
}
|
||||
|
||||
funding, err := exch.GetHistoricalFundingRates(ctx, &fundingrate.HistoricalRatesRequest{
|
||||
@@ -4821,7 +4820,7 @@ func (s *RPCServer) GetLatestFundingRate(ctx context.Context, r *gctrpc.GetLates
|
||||
}
|
||||
|
||||
if !pairs.Contains(cp, true) {
|
||||
return nil, fmt.Errorf("%w %v", errPairNotEnabled, cp)
|
||||
return nil, fmt.Errorf("%w %v", currency.ErrPairNotEnabled, cp)
|
||||
}
|
||||
|
||||
fundingRates, err := exch.GetLatestFundingRates(ctx, &fundingrate.LatestRateRequest{
|
||||
|
||||
Reference in New Issue
Block a user