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:
Ryan O'Hara-Reid
2024-10-21 17:05:26 +11:00
committed by GitHub
parent ba77c9946d
commit bd2cc9d7bb
4 changed files with 7 additions and 3 deletions

View File

@@ -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.

View File

@@ -102,6 +102,7 @@ func (g *Gateio) GenerateDeliveryFuturesDefaultSubscriptions() (subscription.Lis
Channel: channelsToSubscribe[i],
Pairs: currency.Pairs{fPair.Upper()},
Params: params,
Asset: asset.DeliveryFutures,
})
}
}

View File

@@ -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:

View File

@@ -163,6 +163,7 @@ getEnabledPairs:
Channel: channelsToSubscribe[i],
Pairs: currency.Pairs{fPair.Upper()},
Params: params,
Asset: asset.Options,
})
}
}