Skip to content

v0.30.0

Choose a tag to compare

@hogan-yuan hogan-yuan released this 23 Oct 08:49
· 17 commits to main since this release
0cd5533

Adds US account asset APIs and makes AP-only endpoints fail fast for US accounts.

Added

  • US account asset APIs (#135): TradeContext gains USCashAndBuyPower, USAvailableHolding, USTransactionHistory and USExchangeRates (US-only).
  • OrderSideUnknown (""): the side of an execution when the response omits it (US history executions).

Changed

  • FundPositions, MarginRatio, AllExecutions, OrderDetail / OrderDetailAttached, AccountBalance, CashFlow, StockPositions and PortfolioContext.ExchangeRate are AP-only. With US credentials they now return *http.RegionRestrictedError without sending the request.
  • RegionRestrictedError.Error() appends ; <hint> naming the alternative endpoint. Code that checks the message for exact equality must be updated; prefix matching still works.
  • New http.Client.CheckRegionCtx / IsUSCtx resolve the region of an OAuth session. CheckRegion / IsUS are deprecated.

Fixed

  • Region guards now work for OAuth sessions. Before, every OAuth session was treated as AP.
  • USCryptoEntry now has Quantity, prices and the other fields it was missing (#135).
  • OptionChainInfoByDate calls POST /v1/quote/options/strikes. The old endpoint returned 404 in every region (#134).

Full changelog: v0.29.2...v0.30.0