Repository navigation
fix(calendar): expose finance_calendar pagination parameters - #597
Merged
Merged
Conversation
The finance_calendar method issued a single request with no page-size control, so the server's default page cap (~10 events) made even a one-day query look truncated at 10 results. Expose the endpoint's pagination controls instead of hiding them behind an internal loop: add optional `count`, `offset` and `next` (a new CalendarPageDirection enum) parameters and return the response's `next_date` cursor as-is, so callers can page through the full window themselves. Propagated across all layers: Rust core + blocking, C (cbindgen), C++, Java (JNI + FinanceCalendarOptions), Node.js (napi), Python (PyO3). Reported as longbridge/developers#1265
hogan-yuan
force-pushed
the
fix/finance-calendar-paginate
branch
from
September 23, 2026 01:56
e64f3c4 to
a343f9b
Compare
Merged
hogan-yuan
added a commit
that referenced
this pull request
Sep 30, 2026
Release **v5.2.0**. Bumps workspace `5.1.0` → `5.2.0`. ### New since v5.1.0 - **Breaking:** `TradeContext.fund_positions` — the `FundPosition` identifier field is renamed `symbol` → `counter_id` across all layers (C `lb_fund_position_t.counter_id`, C++ `FundPosition::counter_id`, Java `getCounterId()`, Node.js `counterId`, Python `counter_id`). The value is now the full fund `counter_id` (e.g. `UT/FD/HK0000384492`); the ISIN is recoverable as its last `/`-separated segment. Rust keeps a `symbol` serde alias for transition; the request-side filter `GetFundPositionsOptions.symbols` is unchanged (#598) - **Added:** mutual-fund channel `FundContext` / `FundContextSync` — 28 endpoints across fund catalog & market data, the user's fund positions, and fund orders/trading. Funds are addressed by `counter_id` (sent as a query parameter; the `nav` / `performance` / `position_performance` batch endpoints use a one-element `counter_ids` JSON array). Mirrored across C, C++, Java, Node.js and Python (the Go SDK ships separately, openapi-go#124) (#598) - **Changed:** `CalendarContext.finance_calendar` now exposes pagination — `count` / `offset` / `next` (with the new `CalendarPageDirection` enum) (#597) - **Fixed:** C/C++ — resolved a cbindgen name collision from the fund FFI: `CFundPosition` / `CGetFundPositionsOptions` were renamed to `CFundPositionItem` (`lb_fund_position_item_t`) / `CFundPositionsOptions` (`lb_fund_positions_options_t`) so they no longer overwrite the portfolio types (#598) > #598 is technically breaking; released as minor per maintainer decision.
hogan-yuan
added a commit
to longbridge/developers
that referenced
this pull request
Oct 8, 2026
…1267) ## What Sync the calendar reference docs with the SDK change in longbridge/openapi#597 (which exposes the `finance_calendar` pagination parameters), and roll up the outstanding calendar-doc fixes from the now-stale #1125. ### 1. Pagination parameters Add **`count`**, **`offset`** and **`next`** (`CalendarPageDirection`: `Later` / `Earlier`) to the "SDK method parameters" table on every calendar page — split / dividend / earnings / ipo / macro / meeting / merge, across `en`, `zh-CN`, `zh-HK`. ### 2. Fix broken request examples The split / dividend / earnings / ipo / macro pages called non-existent per-category methods like `ctx.split_calendar("AAPL.US")` (wrong name, and a symbol instead of a date range). Every language tab now calls the real method: ``` finance_calendar(CalendarCategory.<Category>, "2024-01-01", "2024-03-31") ``` with the correct category per page (earnings → `Report`, macro → `MacroData`, etc.), consistent with the meeting / merge pages. Rust examples use the new 7-argument signature. ### 3. Missing translations Add `zh-CN` / `zh-HK` `meeting_calendar` and `merge_calendar` pages (4 files) — they previously existed only in English. ### 4. Response examples Fix the misleading Response Example JSON: macro now shows a real macro-economic event instead of a stock, per-day event counts corrected to match the single sample row, and sample dates aligned to the request window. ## Note on #1125 This supersedes #1125, which addressed the same broken examples and missing translations but targeted the pre-`.mdx` docs (the pages were since migrated by `convert-md-to-mdx.ts`) and predates the pagination change, so it can no longer merge cleanly. Related: #1265
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CalendarContext.finance_calendarissued a single request with no page-size control, so the server's default page cap (~10 events) made even a one-day query look truncated at 10 results (reported as longbridge/developers#1265).Rather than hide pagination behind an internal loop, this exposes the endpoint's pagination controls so callers can page through results themselves:
count(max events per page),offset(events to skip), andnext(newCalendarPageDirectionenum:Later/Earlier)next_datecursor as-isTo retrieve a full window, request a larger
count, or re-call with the returnednext_dateasstartuntil it comes back empty.Layers updated
Signature change propagated across every layer:
externfn + cbindgen header regenerated:lb_calendar_page_direction_t)std::optional<...>params + enum)FinanceCalendarOptionsfields +CalendarPageDirectionclass)index.d.ts/index.jsregenerated)openapi.pyi)Verification
cargo clippy --all --all-featuresclean;cargo +nightly fmt --allnpm run build:debugregenerated the Node typingsfinance_calendar(Split)now returns the requested window instead of a hard 10-item capDocs updated in longbridge/developers (separate PR).
Reported as longbridge/developers#1265