File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,7 @@ async def _api(
288
288
params : dict | OrderedDict ,
289
289
signed : bool = False ,
290
290
action : str = 'get'
291
+
291
292
) -> dict [str , Any ]:
292
293
293
294
if signed :
@@ -296,7 +297,7 @@ async def _api(
296
297
resp = await getattr (self ._sesh , action )(
297
298
path = f'/api/v3/{ method } ' ,
298
299
params = params ,
299
- timeout = float ('inf' )
300
+ timeout = float ('inf' ),
300
301
)
301
302
302
303
return resproc (resp , log )
@@ -476,6 +477,7 @@ async def bars(
476
477
async def get_positions (
477
478
self ,
478
479
recv_window : int = 60000
480
+
479
481
) -> tuple :
480
482
positions = {}
481
483
volumes = {}
@@ -509,7 +511,8 @@ async def get_deposits(
509
511
return await self ._sapi (
510
512
'capital/deposit/hisrec' ,
511
513
params = params ,
512
- signed = True )
514
+ signed = True ,
515
+ )
513
516
514
517
async def get_withdrawls (
515
518
self ,
@@ -523,7 +526,8 @@ async def get_withdrawls(
523
526
return await self ._sapi (
524
527
'capital/withdraw/history' ,
525
528
params = params ,
526
- signed = True )
529
+ signed = True ,
530
+ )
527
531
528
532
async def submit_limit (
529
533
self ,
@@ -732,16 +736,15 @@ async def stream_messages(
732
736
# ``msgspec.Struct`` does not runtime-validate until you
733
737
# decode/encode, see:
734
738
# https://jcristharif.com/msgspec/structs.html#type-validation
735
- msg = AggTrade (** msg )
736
- msg .typecast ()
739
+ msg = AggTrade (** msg ) # TODO: should we .copy() ?
737
740
yield 'trade' , {
738
741
'symbol' : msg .s ,
739
742
'last' : msg .p ,
740
743
'brokerd_ts' : time .time (),
741
744
'ticks' : [{
742
745
'type' : 'trade' ,
743
- 'price' : msg .p ,
744
- 'size' : msg .q ,
746
+ 'price' : float ( msg .p ) ,
747
+ 'size' : float ( msg .q ) ,
745
748
'broker_ts' : msg .T ,
746
749
}],
747
750
}
You can’t perform that action at this time.
0 commit comments