Skip to content

tastyware/tastytrade:v12.1.0

Latest

Choose a tag to compare

@Graeme22 Graeme22 released this 03 Mar 22:30

What's Changed

  • Made additional Customer fields optional for compatibility with the sandbox environment by @maneum1 in #302
  • session client parameters by @Ramneantu in #311
    You can now pass kwargs to the httpx.AsyncClient object in the session besides just proxy. Related to this, proxy is now part of these kwargs instead of a separate parameter, and passing ssl_context to DXLinkStreamer is deprecated since its client copies kwargs from the Session object used to initialize it. Proxies are no longer in test coverage. This is technically breaking in two edge cases:
    1. Proxy was passed as a positional arg to session (not sure why anyone would do this though)
    2. Proxy URLs, if stored in serialized sessions, will be dropped when re-serialized.
  • provider_secret and refresh_token parameters to Session are now optional, and if not provided, the environment variables $TT_SECRET and $TT_REFRESH will be tried.
  • In a lot of places, passing a string is valid even though a non-string iterable is expected, eg here:
    await streamer.subscribe(Quote, "SPY")
    This would actually subscribe to "S", "P", and "Y"! So now across the whole SDK, in places where str isn't allowed by itself, we simply wrap it in a list. This means the above code now behaves as expected.
  • Leg now has a multiplier property which is its quantity multiplied by its order action (-1 for sell, +1 for buy)
  • Rename Session._refresh to Session.refresh and add flag to force refresh the session if needed (as discussed in #309)
  • DXLinkStreamer.subscribe_candle can be called without the start_time parameter and defaults to the timestamp 1e9. This mirrors the way the Tastytrade web client typically uses the streamer.

New Contributors

Full Changelog: v12.0.2...v12.1.0