@@ -221,13 +221,13 @@ class FundingRateHistoryView:
221221 # specifies the date and time in UNIX timestamp format
222222 d : int = 0
223223 # specifies the funding rate
224- f : float = 0.0
224+ f : Optional [ float ] = None
225225
226226 @classmethod
227227 def from_dict (cls , data : dict ) -> FundingRateHistoryView :
228228 return cls (
229229 d = data .get ("d" , 0 ),
230- f = data .get ("f" , 0.0 ),
230+ f = data .get ("f" ),
231231 )
232232
233233
@@ -240,9 +240,9 @@ class FundingRateLatestResponse:
240240 # Specifies the exchange
241241 e : str = ""
242242 # Specifies the funding rate
243- f : float = 0.0
243+ f : Optional [ float ] = None
244244 # Specifies the interval hours
245- i : int = 0
245+ i : Optional [ int ] = None
246246 # Specifies the token id
247247 id : str = ""
248248 # Specifies the quote
@@ -256,8 +256,8 @@ def from_dict(cls, data: dict) -> FundingRateLatestResponse:
256256 b = data .get ("b" , "" ),
257257 d = data .get ("d" , 0 ),
258258 e = data .get ("e" , "" ),
259- f = data .get ("f" , 0.0 ),
260- i = data .get ("i" , 0 ),
259+ f = data .get ("f" ),
260+ i = data .get ("i" ),
261261 id = data .get ("id" , "" ),
262262 q = data .get ("q" , "" ),
263263 s = data .get ("s" , "" ),
@@ -295,29 +295,29 @@ class LiquidationEntry:
295295 base : str = ""
296296 exchange : str = ""
297297 price : float = 0.0
298- price_usd : float = 0.0
298+ price_usd : Optional [ float ] = None
299299 quote : str = ""
300300 side : str = ""
301301 symbol : str = ""
302302 timestamp : int = 0
303303 token_id : str = ""
304304 volume : float = 0.0
305- volume_usd : float = 0.0
305+ volume_usd : Optional [ float ] = None
306306
307307 @classmethod
308308 def from_dict (cls , data : dict ) -> LiquidationEntry :
309309 return cls (
310310 base = data .get ("base" , "" ),
311311 exchange = data .get ("exchange" , "" ),
312312 price = data .get ("price" , 0.0 ),
313- price_usd = data .get ("priceUsd" , 0.0 ),
313+ price_usd = data .get ("priceUsd" ),
314314 quote = data .get ("quote" , "" ),
315315 side = data .get ("side" , "" ),
316316 symbol = data .get ("symbol" , "" ),
317317 timestamp = data .get ("timestamp" , 0 ),
318318 token_id = data .get ("tokenId" , "" ),
319319 volume = data .get ("volume" , 0.0 ),
320- volume_usd = data .get ("volumeUsd" , 0.0 ),
320+ volume_usd = data .get ("volumeUsd" ),
321321 )
322322
323323
@@ -326,29 +326,29 @@ class LiquidationFeedEntry:
326326 base : str = ""
327327 exchange : str = ""
328328 price : float = 0.0
329- price_usd : float = 0.0
329+ price_usd : Optional [ float ] = None
330330 quote : str = ""
331331 side : str = ""
332332 symbol : str = ""
333333 timestamp : int = 0
334334 token_id : str = ""
335335 volume : float = 0.0
336- volume_usd : float = 0.0
336+ volume_usd : Optional [ float ] = None
337337
338338 @classmethod
339339 def from_dict (cls , data : dict ) -> LiquidationFeedEntry :
340340 return cls (
341341 base = data .get ("base" , "" ),
342342 exchange = data .get ("exchange" , "" ),
343343 price = data .get ("price" , 0.0 ),
344- price_usd = data .get ("priceUsd" , 0.0 ),
344+ price_usd = data .get ("priceUsd" ),
345345 quote = data .get ("quote" , "" ),
346346 side = data .get ("side" , "" ),
347347 symbol = data .get ("symbol" , "" ),
348348 timestamp = data .get ("timestamp" , 0 ),
349349 token_id = data .get ("tokenId" , "" ),
350350 volume = data .get ("volume" , 0.0 ),
351- volume_usd = data .get ("volumeUsd" , 0.0 ),
351+ volume_usd = data .get ("volumeUsd" ),
352352 )
353353
354354
@@ -607,7 +607,7 @@ class LiquidationSymbolHistoryBucket:
607607 # Liquidated long positions in USD over this bucket (Side='sell').
608608 long_usd : float = 0.0
609609 # Candle close mid for the same bucket. nil when no candle exists (very early in a newly listed pair, or when the price feed is down). FE renders the price line with `connectNulls=false` so gaps stay visible instead of being smoothed across.
610- price : float = 0.0
610+ price : Optional [ float ] = None
611611 # Liquidated short positions in USD over this bucket (Side='buy').
612612 short_usd : float = 0.0
613613 # Convenience sum so the FE can drive a "total" line without re-add.
@@ -619,7 +619,7 @@ class LiquidationSymbolHistoryBucket:
619619 def from_dict (cls , data : dict ) -> LiquidationSymbolHistoryBucket :
620620 return cls (
621621 long_usd = data .get ("longUsd" , 0.0 ),
622- price = data .get ("price" , 0.0 ),
622+ price = data .get ("price" ),
623623 short_usd = data .get ("shortUsd" , 0.0 ),
624624 total_usd = data .get ("totalUsd" , 0.0 ),
625625 ts = data .get ("ts" , 0 ),
@@ -722,7 +722,7 @@ class OpenInterestListEntry:
722722 base : str = ""
723723 exchange : str = ""
724724 open_interest : float = 0.0
725- open_interest_usd : float = 0.0
725+ open_interest_usd : Optional [ float ] = None
726726 quote : str = ""
727727 symbol : str = ""
728728 timestamp : int = 0
@@ -734,7 +734,7 @@ def from_dict(cls, data: dict) -> OpenInterestListEntry:
734734 base = data .get ("base" , "" ),
735735 exchange = data .get ("exchange" , "" ),
736736 open_interest = data .get ("openInterest" , 0.0 ),
737- open_interest_usd = data .get ("openInterestUsd" , 0.0 ),
737+ open_interest_usd = data .get ("openInterestUsd" ),
738738 quote = data .get ("quote" , "" ),
739739 symbol = data .get ("symbol" , "" ),
740740 timestamp = data .get ("timestamp" , 0 ),
@@ -794,7 +794,7 @@ class OpenInterestResponse:
794794 base : str = ""
795795 exchange : str = ""
796796 open_interest : float = 0.0
797- open_interest_usd : float = 0.0
797+ open_interest_usd : Optional [ float ] = None
798798 quote : str = ""
799799 symbol : str = ""
800800 timestamp : int = 0
@@ -806,7 +806,7 @@ def from_dict(cls, data: dict) -> OpenInterestResponse:
806806 base = data .get ("base" , "" ),
807807 exchange = data .get ("exchange" , "" ),
808808 open_interest = data .get ("openInterest" , 0.0 ),
809- open_interest_usd = data .get ("openInterestUsd" , 0.0 ),
809+ open_interest_usd = data .get ("openInterestUsd" ),
810810 quote = data .get ("quote" , "" ),
811811 symbol = data .get ("symbol" , "" ),
812812 timestamp = data .get ("timestamp" , 0 ),
@@ -1287,52 +1287,52 @@ class TickerView:
12871287 # specifies the exchange name
12881288 e : str = ""
12891289 # highest bid from orderbook
1290- hb : float = 0.0
1290+ hb : Optional [ float ] = None
12911291 # lowest ask from orderbook
1292- la : float = 0.0
1292+ la : Optional [ float ] = None
12931293 # lower depth(2%)
1294- ld : float = 0.0
1294+ ld : Optional [ float ] = None
12951295 # specifies the market type
12961296 m : str = ""
12971297 # specifies the latest price
1298- p : float = 0.0
1298+ p : Optional [ float ] = None
12991299 # specifies the price 24 hours ago
1300- p24h : float = 0.0
1300+ p24h : Optional [ float ] = None
13011301 # specified price change between the latest price and the price 24 hours ago
1302- pc : float = 0.0
1302+ pc : Optional [ float ] = None
13031303 # specifies the quote token
13041304 q : str = ""
13051305 # specifies the symbol (base-quote)
13061306 s : str = ""
13071307 # upper depth(2%)
1308- ud : float = 0.0
1308+ ud : Optional [ float ] = None
13091309 # specifies the trading volume in the last 24 hours
1310- v : float = 0.0
1310+ v : Optional [ float ] = None
13111311
13121312 @classmethod
13131313 def from_dict (cls , data : dict ) -> TickerView :
13141314 return cls (
13151315 b = data .get ("b" , "" ),
13161316 d = data .get ("d" , 0 ),
13171317 e = data .get ("e" , "" ),
1318- hb = data .get ("hb" , 0.0 ),
1319- la = data .get ("la" , 0.0 ),
1320- ld = data .get ("ld" , 0.0 ),
1318+ hb = data .get ("hb" ),
1319+ la = data .get ("la" ),
1320+ ld = data .get ("ld" ),
13211321 m = data .get ("m" , "" ),
1322- p = data .get ("p" , 0.0 ),
1323- p24h = data .get ("p24h" , 0.0 ),
1324- pc = data .get ("pc" , 0.0 ),
1322+ p = data .get ("p" ),
1323+ p24h = data .get ("p24h" ),
1324+ pc = data .get ("pc" ),
13251325 q = data .get ("q" , "" ),
13261326 s = data .get ("s" , "" ),
1327- ud = data .get ("ud" , 0.0 ),
1328- v = data .get ("v" , 0.0 ),
1327+ ud = data .get ("ud" ),
1328+ v = data .get ("v" ),
13291329 )
13301330
13311331
13321332@dataclass
13331333class TokenDetail :
13341334 # specifies cmc id of the token
1335- cmc_id : str = ""
1335+ cmc_id : Optional [ str ] = None
13361336 # specifies the token icon url path
13371337 icon : str = ""
13381338 # specifies the unique id
@@ -1345,7 +1345,7 @@ class TokenDetail:
13451345 @classmethod
13461346 def from_dict (cls , data : dict ) -> TokenDetail :
13471347 return cls (
1348- cmc_id = data .get ("cmc_id" , "" ),
1348+ cmc_id = data .get ("cmc_id" ),
13491349 icon = data .get ("icon" , "" ),
13501350 id = data .get ("id" , "" ),
13511351 name = data .get ("name" , "" ),
0 commit comments