mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
gateio: Small update on fields and subscriptions (#1658)
* Cherry_pickable * gateio/websocket: use millisecond time for more accurate push time --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -708,6 +708,7 @@ type FuturesCandlestick struct {
|
||||
HighestPrice types.Number `json:"h"`
|
||||
LowestPrice types.Number `json:"l"`
|
||||
OpenPrice types.Number `json:"o"`
|
||||
Sum types.Number `json:"sum"` // Trading volume (unit: Quote currency)
|
||||
|
||||
// Added for websocket push data
|
||||
Name string `json:"n,omitempty"`
|
||||
@@ -1822,8 +1823,8 @@ type OrderCreateParams struct {
|
||||
Iceberg int64 `json:"iceberg"`
|
||||
Price string `json:"price"` // NOTE: Market orders require string "0"
|
||||
TimeInForce string `json:"tif"`
|
||||
Text string `json:"text"`
|
||||
ClosePosition bool `json:"close,omitempty"`
|
||||
Text string `json:"text,omitempty"` // Omitempty required as payload sent as `text:""` will return error message: Text content not starting with `t-`"
|
||||
ClosePosition bool `json:"close,omitempty"` // Size needs to be zero if true
|
||||
ReduceOnly bool `json:"reduce_only,omitempty"`
|
||||
AutoSize string `json:"auto_size,omitempty"`
|
||||
Settle string `json:"-"` // Used in URL.
|
||||
|
||||
@@ -102,6 +102,7 @@ func (g *Gateio) GenerateDeliveryFuturesDefaultSubscriptions() (subscription.Lis
|
||||
Channel: channelsToSubscribe[i],
|
||||
Pairs: currency.Pairs{fPair.Upper()},
|
||||
Params: params,
|
||||
Asset: asset.DeliveryFutures,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ func (g *Gateio) GenerateFuturesDefaultSubscriptions(settlement currency.Code) (
|
||||
Channel: channelsToSubscribe[i],
|
||||
Pairs: currency.Pairs{fPair.Upper()},
|
||||
Params: params,
|
||||
Asset: asset.Futures,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -182,7 +183,7 @@ func (g *Gateio) WsHandleFuturesData(_ context.Context, respRaw []byte, a asset.
|
||||
case futuresTradesChannel:
|
||||
return g.processFuturesTrades(respRaw, a)
|
||||
case futuresOrderbookChannel:
|
||||
return g.processFuturesOrderbookSnapshot(push.Event, push.Result, a, push.Time.Time())
|
||||
return g.processFuturesOrderbookSnapshot(push.Event, push.Result, a, push.TimeMs.Time())
|
||||
case futuresOrderbookTickerChannel:
|
||||
return g.processFuturesOrderbookTicker(push.Result)
|
||||
case futuresOrderbookUpdateChannel:
|
||||
|
||||
@@ -163,6 +163,7 @@ getEnabledPairs:
|
||||
Channel: channelsToSubscribe[i],
|
||||
Pairs: currency.Pairs{fPair.Upper()},
|
||||
Params: params,
|
||||
Asset: asset.Options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user