ib: fix `Client.trades()` return type annot

account_tests
Tyler Goodlet 2023-06-29 14:03:57 -04:00
parent 9748b22d34
commit c0929c042a
1 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,10 @@ from contextlib import (
contextmanager as cm,
)
from contextlib import AsyncExitStack
from dataclasses import asdict, astuple
from dataclasses import (
asdict,
astuple,
)
from datetime import datetime
from functools import (
partial,
@ -402,13 +405,13 @@ class Client:
# NOTE: the ib.client here is "throttled" to 45 rps by default
async def trades(self) -> dict[str, Any]:
async def trades(self) -> list[dict]:
'''
Return list of trade-fills from current session in ``dict``.
'''
fills: list[Fill] = self.ib.fills()
norm_fills: list[dict] = []
fills: list[Fill] = self.ib.fills()
for fill in fills:
fill = fill._asdict() # namedtuple
for key, val in fill.items():