Repository navigation
v5.5.0
-
TradeContext.risk_assessment(): returns the member's risk assessment (suitability questionnaire) result fromGET /v1/members/me/risk-assessment— risk level, score, professional-investor status and the approval state of each item. Mirrors the server response field for field; decoding is lenient so a change in how the gateway encodes a value cannot fail the call. Available in Rust, C, C++, Java, Node.js and Python (#625) -
TLS now trusts the operating system's certificate store in addition to the bundled webpki roots. Behind a corporate TLS-inspecting proxy every HTTPS call previously failed with
invalid peer certificate: UnknownIssuereven though other clients on the same machine worked. The two root sets are unioned, so a machine with an empty or unreadable OS store behaves exactly as before. Covers the HTTP client, the geo lookup and the quote/trade WebSocket connections (#628)This widens what the SDK trusts: previously only the roots compiled into the binary were accepted, so a certificate authority installed on the machine could not intercept SDK traffic; now one can. That is what makes an inspecting proxy work, and it is the same trust the rest of the software on that host already relies on — but if you ran the SDK specifically because it ignored the local trust store, this changes that.
-
history_orders()now returns every page. The endpoint caps a response at 1000 records and reports the overflow inhas_more, which the SDK dropped, so a caller whose window held more than 1000 orders silently got a truncated list with no way to tell. The return type is unchanged, so no code needs updating — but the call now issues one request per page instead of always one, so a wide window is slower and consumes more of your rate limit. Narrowstart_at/end_atif that matters; with neither set the server defaults to a 90-day window (#627) -
Zero-padded HK symbols are accepted on trade and asset calls.
00700.HK, the form the Longbridge apps display, is canonicalized to700.HK. Previously/v1/asset/stock?symbol=00700.HKanswered200with no positions instead of an error, so a padded symbol looked like an empty account rather than a mistake. Coversstock_positions,history_orders,today_orders,history_executions,today_executions,all_executions,cash_flow,margin_ratio,estimate_max_purchase_quantityandsubmit_order. Other markets, A-share codes included, are sent unchanged (#627) -
OAuth authorization errors include
error_description, e.g.OAuth authorization failed: internal_server_error: validate client err:oauth client not foundinstead of only the bare error code, which makes an unknown or placeholderclient_ideasy to spot (#626) -
Security: the local OAuth callback page HTML-escapes the error text taken from the redirect. It was previously inserted as raw HTML, so any web page could redirect the browser to
http://localhost:<port>/callback?error=<script>…and run script on thelocalhostorigin while an authorization was pending (#626) -
Security: the OAuth callback checks
stateon error redirects too. A callback whosestatedoes not match the pending authorization is answered with an error page and ignored, and the flow keeps waiting for the real redirect. Previously any web page could end a pending authorization with an error text of its choosing. The flow no longer returnsCsrfTokenMismatch; a redirect with a wrong or missingstatenow leaves it waiting, so without a valid redirect it ends withAuthorizationTimeoutafter 5 minutes. Rust code matchingCsrfTokenMismatchfrom the authorization flow should handleAuthorizationTimeoutinstead (#626) -
Internal: the WebSocket TLS connector and the OAuth token HTTP client are each built once instead of per connection and per token refresh. Reading the OS trust store costs ~90ms and is not cached, so without this the first change above would have added that to every reconnect and every refresh (#628)