piker/piker/brokers
Tyler Goodlet 844544ed8e Port binance to `httpx`
Like other backends use the `AsyncClient` for all venue specific
client-sessions but change to allocating them inside `get_client()`
using an `AsyncExitStack` and inserting directly in the
`Client.venue_sesh: dict` table during init.

Supporting impl tweaks:
- remove most of the API client session building logic and instead make
  `Client.__init__()` take in a `venue_sessions: dict` (set it to
  `.venue_sesh`) and `conf: dict`, instead opting to do the http client
  configuration inside `get_client()` since all that code only needs to
  be run once.
 |_load config inside `get_client()` once.
 |_move session token creation into a new util func `init_api_keys()` and
  also call it from `get_client()` factory; toss in an ex. toml section
  config to the doc string.
- define `_venue_urls: dict[str, str]` (content taken from old static
  `.venue_sesh` dict) at module level and feed them as `base_url: str`
  inputs to the client create loop.
- adjust all call sigs in httpx-sesh-using methods, namely just
  `._api()`.
- do a `.exch_info()` call in `get_client()` to cache the symbology
  set.

Unrelated changes for various other outstanding buggers:
- to get futures feeds correctly loading when selected
  from search (like 'XMRUSDT.USDTM.PERP'), expect a `MktPair` input to
  `Client.bars()` such that the exact venue-key can be looked up (via
  a new `.pair2venuekey()` meth) and then passed to `._api()`.
- adjust `.broker.open_trade_dialog()` to failover to paper engine when
  there's no `api_key` key set for the `subconf` venue-key.
2025-02-11 16:27:28 -05:00
..
binance Port binance to `httpx` 2025-02-11 16:27:28 -05:00
deribit deribit: switch to `rapidfuzz` API 2023-09-21 19:44:27 -04:00
ib ib: add connect status info emit 2025-02-11 14:56:17 -05:00
kraken Change type-annots to use `httpx.Response` 2025-02-11 16:27:28 -05:00
__init__.py Change type-annots to use `httpx.Response` 2025-02-11 16:27:28 -05:00
_daemon.py brokers._daemon: drop question-comment about enabling feed module 2023-08-25 13:33:59 -04:00
_util.py Change type-annots to use `httpx.Response` 2025-02-11 16:27:28 -05:00
cli.py Delegate `.toolz.open_crash_handler()` to `tractor.devx` 2024-01-16 10:26:38 -05:00
core.py Temporarily use crash handler around search CLI ep 2023-09-29 14:02:17 -04:00
data.py Use common `.brokers` logger in most backends 2023-05-09 14:49:26 -04:00
kucoin.py Woops, `data` can be an empty list XD 2025-02-11 16:27:28 -05:00
questrade.py Move `._cacheables.open_cached_client()` into `.brokers` pkg mod 2023-06-27 13:41:47 -04:00
robinhood.py Use common `.brokers` logger in most backends 2023-05-09 14:49:26 -04:00