1- from typing import Optional , List
1+ from typing import Optional , List , Union
22from ...modelclass import modelclass
33
44
@@ -150,6 +150,7 @@ class FuturesQuote:
150150 bid_price : Optional [float ] = None
151151 bid_size : Optional [float ] = None
152152 bid_timestamp : Optional [int ] = None
153+ channel : Optional [int ] = None
153154 report_sequence : Optional [int ] = None
154155 sequence_number : Optional [int ] = None
155156
@@ -165,6 +166,7 @@ def from_dict(d):
165166 bid_price = d .get ("bid_price" ),
166167 bid_size = d .get ("bid_size" ),
167168 bid_timestamp = d .get ("bid_timestamp" ),
169+ channel = d .get ("channel" ),
168170 report_sequence = d .get ("report_sequence" ),
169171 sequence_number = d .get ("sequence_number" ),
170172 )
@@ -180,6 +182,7 @@ class FuturesTrade:
180182 ticker : Optional [str ] = None
181183 timestamp : Optional [int ] = None
182184 session_end_date : Optional [str ] = None
185+ channel : Optional [int ] = None
183186 price : Optional [float ] = None
184187 size : Optional [float ] = None
185188 report_sequence : Optional [int ] = None
@@ -191,6 +194,7 @@ def from_dict(d):
191194 ticker = d .get ("ticker" ),
192195 timestamp = d .get ("timestamp" ),
193196 session_end_date = d .get ("session_end_date" ),
197+ channel = d .get ("channel" ),
194198 price = d .get ("price" ),
195199 size = d .get ("size" ),
196200 report_sequence = d .get ("report_sequence" ),
@@ -248,13 +252,17 @@ def from_dict(d):
248252@modelclass
249253class FuturesSnapshotDetails :
250254 open_interest : Optional [int ] = None
251- settlement_date : Optional [int ] = None
255+ settlement_date : Optional [Union [str , int ]] = None
256+ ticker : Optional [str ] = None
257+ product_code : Optional [str ] = None
252258
253259 @staticmethod
254260 def from_dict (d ):
255261 return FuturesSnapshotDetails (
256262 open_interest = d .get ("open_interest" ),
257263 settlement_date = d .get ("settlement_date" ),
264+ ticker = d .get ("ticker" ),
265+ product_code = d .get ("product_code" ),
258266 )
259267
260268
@@ -354,6 +362,7 @@ def from_dict(d):
354362class FuturesSnapshot :
355363 ticker : Optional [str ] = None
356364 product_code : Optional [str ] = None
365+
357366 details : Optional [FuturesSnapshotDetails ] = None
358367 last_minute : Optional [FuturesSnapshotMinute ] = None
359368 last_quote : Optional [FuturesSnapshotQuote ] = None
@@ -362,14 +371,11 @@ class FuturesSnapshot:
362371
363372 @staticmethod
364373 def from_dict (d ):
374+ details_dict = d .get ("details" ) or {}
365375 return FuturesSnapshot (
366- ticker = d .get ("ticker" ),
367- product_code = d .get ("product_code" ),
368- details = (
369- FuturesSnapshotDetails .from_dict (d .get ("details" , {}))
370- if d .get ("details" )
371- else None
372- ),
376+ ticker = d .get ("ticker" ) or details_dict .get ("ticker" ),
377+ product_code = d .get ("product_code" ) or details_dict .get ("product_code" ),
378+ details = FuturesSnapshotDetails .from_dict (details_dict ),
373379 last_minute = (
374380 FuturesSnapshotMinute .from_dict (d .get ("last_minute" , {}))
375381 if d .get ("last_minute" )
0 commit comments