Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/en/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ sidebar_icon: newspaper
description: 'Release notes for Longbridge OpenAPI, CLI, MCP and SDKs, newest first: new commands, API endpoints, MCP tools and other changes.'
---

## 2026-11-20

### SDK v5.5.0

- **Risk assessment** — new `TradeContext.risk_assessment()` returns the risk assessment profile of the account the access token belongs to: the risk level and score of the latest assessment, the professional investor (PI) status, and the approval state of each item. Available in all six languages
- **TLS now trusts the operating system's certificate store** — behind a corporate TLS-inspecting proxy every HTTPS call previously failed with `invalid peer certificate: UnknownIssuer` even though other clients on the same machine worked. The OS store and the bundled roots are unioned, so a machine with an empty or unreadable store behaves exactly as before. **Note that this widens what the SDK trusts**: a certificate authority installed on the machine can now intercept SDK traffic
- **`history_orders()` returns every page** — the endpoint caps a response at 1000 records and reports the overflow in `has_more`, which the SDK dropped, so a caller whose window held more than 1000 orders silently got a truncated list. The return type is unchanged, so no code needs updating — but the call now issues one request per page, so a wide window is slower and consumes more of your rate limit; narrow `start_at` / `end_at` if that matters (with neither set the server defaults to 90 days)
- **Trade and asset calls accept zero-padded HK symbols** — `00700.HK`, the form the Longbridge apps display, is canonicalized to `700.HK`. Previously `/v1/asset/stock?symbol=00700.HK` answered `200` with **no** positions, so a padded symbol looked like an empty account rather than a mistake
- **Security: the OAuth callback page HTML-escapes the error text** — 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 the `localhost` origin while an authorization was pending
- **Security: the OAuth callback checks `state` on error redirects too** — a callback whose `state` does not match 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
- **OAuth authorization errors include `error_description`** — not just the bare error code, which makes a placeholder `client_id` easy to spot

## 2026-11-09

### SDK v5.4.0

- **OAuth `revoke()` / `clear()`** — `revoke()` revokes the current token on the server (RFC 7009 `POST /oauth2/revoke`) without touching the local copy; `clear()` drops the token locally (in-memory and cached file) without contacting the server. Call `revoke()` then `clear()` to disconnect completely. Available in all six languages
- **PKCE in the browser authorization flow** — the authorization request carries a `code_challenge` (RFC 7636, `S256`) and the token exchange sends the `code_verifier`
- **Typed OAuth error codes** — `OAuthError::code()` returns a stable number, exposed as `lb_error_code` (C), `Status::code()` (C++) and on `OpenApiException` (Java, Python), so callers can tell failures apart without parsing messages
- **Token requests are bounded** — refresh and revoke time out after 30s instead of holding the token lock indefinitely

## 2026-10-23

### CLI v0.31.0
Expand Down
21 changes: 21 additions & 0 deletions docs/zh-CN/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ sidebar_icon: newspaper
description: 'Longbridge OpenAPI、CLI、MCP 与 SDK 的更新日志,按时间倒序列出新增命令、接口、MCP 工具及其他变更。'
---

## 2026-11-20

### SDK v5.5.0

- **风险测评** — 新增 `TradeContext.risk_assessment()`,返回 access token 所属账户的风险测评档案:最近一次测评的风险等级与得分、专业投资者(PI)状态,以及 `approvals` 中各项的状态。六种语言均已支持
- **TLS 改为信任操作系统证书库** — 在企业 TLS 拦截代理(如 Zscaler)后面,此前所有 HTTPS 请求都会以 `invalid peer certificate: UnknownIssuer` 失败,尽管同一台机器上的其他客户端工作正常。系统证书库与内置根证书取并集,证书库为空或不可读的机器行为不变。**注意这会扩大 SDK 的信任面**:安装在本机上的证书颁发机构从此可以拦截 SDK 流量
- **`history_orders()` 返回全部分页** — 该接口单次最多返回 1000 条并用 `has_more` 标记溢出,SDK 此前丢弃了这个标记,窗口内超过 1000 单的调用方会静默拿到被截断的列表。返回类型不变,无需改代码;但调用会按页发多次请求,范围过宽时更慢也更吃限流,可收窄 `start_at` / `end_at`(两者都不传时服务端默认 90 天)
- **交易与资产接口接受带前导零的港股代码** — `00700.HK`(Longbridge 各客户端显示的形式)会被规范化为 `700.HK`。此前 `/v1/asset/stock?symbol=00700.HK` 返回 `200` 但**没有任何持仓**,看起来像空账户而不是写错了
- **安全:OAuth 回调页对错误文本做 HTML 转义** — 此前作为原始 HTML 插入,任何网页都能把浏览器重定向到 `http://localhost:<端口>/callback?error=<script>…`,在授权等待期间于 `localhost` 源上执行脚本
- **安全:OAuth 回调对错误重定向同样校验 `state`** — `state` 不匹配的回调会返回错误页并被忽略,流程继续等待真正的重定向。此前任何网页都能用自选的错误文本终止一个进行中的授权
- **OAuth 授权错误带上 `error_description`** — 不再只有错误码,占位用的 `client_id` 之类问题一眼可辨

## 2026-11-09

### SDK v5.4.0

- **OAuth `revoke()` / `clear()`** — `revoke()` 通过 RFC 7009 的 `POST /oauth2/revoke` 在服务端吊销当前 token,不触碰本地副本;`clear()` 只在本地丢弃 token(内存 + 缓存文件),不联系服务端。要完全断开连接,先 `revoke()` 再 `clear()`。六种语言均已支持
- **授权流程改用 PKCE** — 授权请求携带 `code_challenge`(RFC 7636,`S256`),换取 token 时带上 `code_verifier`
- **类型化的 OAuth 错误码** — `OAuthError::code()` 返回稳定数值,并在 C(`lb_error_code`)、C++(`Status::code()`)、Java 与 Python(`OpenApiException`)中暴露,调用方无需解析错误文本即可区分失败原因
- **token 请求有了超时上限** — 刷新与吊销 30 秒超时,不再无限期持有 token 锁

## 2026-10-23

### CLI v0.31.0
Expand Down
21 changes: 21 additions & 0 deletions docs/zh-HK/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ sidebar_icon: newspaper
description: 'Longbridge OpenAPI、CLI、MCP 與 SDK 的更新日誌,按時間倒序列出新增命令、接口、MCP 工具及其他變更。'
---

## 2026-11-20

### SDK v5.5.0

- **風險測評** — 新增 `TradeContext.risk_assessment()`,返回 access token 所屬賬戶的風險測評檔案:最近一次測評的風險等級與得分、專業投資者(PI)狀態,以及 `approvals` 中各項的狀態。六種語言均已支持
- **TLS 改為信任操作系統證書庫** — 在企業 TLS 攔截代理(如 Zscaler)後面,此前所有 HTTPS 請求都會以 `invalid peer certificate: UnknownIssuer` 失敗,儘管同一台機器上的其他客戶端工作正常。系統證書庫與內置根證書取並集,證書庫為空或不可讀的機器行為不變。**注意這會擴大 SDK 的信任面**:安裝在本機上的證書頒發機構從此可以攔截 SDK 流量
- **`history_orders()` 返回全部分頁** — 該接口單次最多返回 1000 條並用 `has_more` 標記溢出,SDK 此前丟棄了這個標記,窗口內超過 1000 單的調用方會靜默拿到被截斷的列表。返回類型不變,無需改代碼;但調用會按頁發多次請求,範圍過寬時更慢也更吃限流,可收窄 `start_at` / `end_at`(兩者都不傳時服務端默認 90 天)
- **交易與資產接口接受帶前導零的港股代碼** — `00700.HK`(Longbridge 各客戶端顯示的形式)會被規範化為 `700.HK`。此前 `/v1/asset/stock?symbol=00700.HK` 返回 `200` 但**沒有任何持倉**,看起來像空賬戶而不是寫錯了
- **安全:OAuth 回調頁對錯誤文本做 HTML 轉義** — 此前作為原始 HTML 插入,任何網頁都能把瀏覽器重定向到 `http://localhost:<端口>/callback?error=<script>…`,在授權等待期間於 `localhost` 源上執行腳本
- **安全:OAuth 回調對錯誤重定向同樣校驗 `state`** — `state` 不匹配的回調會返回錯誤頁並被忽略,流程繼續等待真正的重定向。此前任何網頁都能用自選的錯誤文本終止一個進行中的授權
- **OAuth 授權錯誤帶上 `error_description`** — 不再只有錯誤碼,佔位用的 `client_id` 之類問題一眼可辨

## 2026-11-09

### SDK v5.4.0

- **OAuth `revoke()` / `clear()`** — `revoke()` 通過 RFC 7009 的 `POST /oauth2/revoke` 在服務端吊銷當前 token,不觸碰本地副本;`clear()` 只在本地丟棄 token(內存 + 緩存文件),不聯繫服務端。要完全斷開連接,先 `revoke()` 再 `clear()`。六種語言均已支持
- **授權流程改用 PKCE** — 授權請求攜帶 `code_challenge`(RFC 7636,`S256`),換取 token 時帶上 `code_verifier`
- **類型化的 OAuth 錯誤碼** — `OAuthError::code()` 返回穩定數值,並在 C(`lb_error_code`)、C++(`Status::code()`)、Java 與 Python(`OpenApiException`)中暴露,調用方無需解析錯誤文本即可區分失敗原因
- **token 請求有了超時上限** — 刷新與吊銷 30 秒超時,不再無限期持有 token 鎖

## 2026-10-23

### CLI v0.31.0
Expand Down
Loading