Skip to content

Commit 283532d

Browse files
Copilotsunli829
andauthored
Merge remote-tracking branch 'origin/main' into feat/trade-submit-multileg
# Conflicts: # CHANGELOG.md # c/src/trade_context/context.rs # c/src/trade_context/types.rs # nodejs/index.d.ts Co-authored-by: sunli829 <20092316+sunli829@users.noreply.github.com>
2 parents ee490a2 + 32cb424 commit 283532d

98 files changed

Lines changed: 13640 additions & 201 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
- **All languages:** add `TradeContext.submit_multileg` (`POST /v1/trade/order/multileg`) — submit a multi-leg option combination order (vertical spreads, straddles, strangles, collars, etc.) whose legs are placed together as a single strategy order. Takes `side`, `order_type`, `submitted_quantity`, `strategy` (`MultiLegStrategy`), a list of legs (`symbol` + `ratio_quantity`), and optional `submitted_price` / `remark` / `client_request_id`; returns the existing `SubmitOrderResponse`
1212
- **All languages:** order queries and the order push now expose multi-leg strategy information. `Order` (from `today_orders` / `history_orders`), `OrderDetail` (from `order_detail`), and the `PushOrderChanged` order-changed event gain an optional `multi_leg` field (`MultiLegInfo`) — present only for multi-leg option combination orders — carrying the `strategy`, `strategy_name`, `multileg_id`, `code`, and the combination `legs` (each with `symbol`, `side`, `position`, `ratio_quantity`, `strike_price`, `expire_date`, and `contract_direction`). Adds the `MultiLegStrategy`, `MultiLegPosition`, and `ContractDirection` enums
13+
- **All languages:** add grid-trading support via a standalone `GridContext` — submit / replace / cancel / suspend / restart grid orders, list orders (paged and by IDs), fetch order detail and trigger history, submit the strategy risk-disclosure questionnaire, and query the security (symbol) info (`symbol_info``GridSymbolInfo`: name, last price, lot sizes, price-step rules, channel/authorization) needed to build a grid order. Available in the Rust, Python, Node.js, Java, and C/C++ bindings
1314
- **All languages:** `Execution` gains a `side` field (`OrderSide`) — the buy/sell direction of the fill, now returned by the `today_executions`, `history_executions`, and `all_executions` responses
1415

1516
### Fixed
1617

1718
- **All languages:** the AI Agent streamed conversation no longer errors mid-run when the server sends an explicit `"outputs": null`. `WorkflowFinishedPayload.outputs`, `NodeToolUseFinishedPayload.outputs`, and `SubagentFinishedPayload.outputs` were annotated `#[serde(default)]`, which only covers a *missing* key, not an explicit `null` — so a `workflow_finished` / `node_tool_use_finished` / `subagent_finished` event carrying `null` outputs failed to deserialize and aborted the whole event stream (`invalid type: null, expected struct WorkflowOutputs`). These fields now map `null` to the type's default
1819
- **All languages:** likewise, list-typed fields on the streamed AI Agent event payloads no longer error on an explicit `null` (`invalid type: null, expected a sequence`). `tip_chips` (on the node / subagent / agent-tool `*_started` payloads), `WorkflowFinishedPayload.process_data`, and `SubagentStartedPayload.tools` were `#[serde(default)]`, which does not accept an explicit `null`; they now deserialize `null` to an empty list
20+
- **All languages:** clarified that `CompanyOverview.employees` is typed as a **string** (not an integer) across all SDK languages — the Longbridge API returns this field as a JSON string (e.g. `"10000"`). Doc comments have been updated to make this explicit and prevent downstream tools from incorrectly treating the value as an integer
1921

2022
## [4.5.0] - 2026-08-14
2123

c/cbindgen.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ cpp_compat = true
111111
"COrderChargeItem" = "lb_order_charge_item_t"
112112
"COrderChargeDetail" = "lb_order_charge_detail_t"
113113
"COrderDetail" = "lb_order_detail_t"
114+
"CGridTradeRule" = "lb_grid_trade_rule_t"
115+
"CSubmitGridOrderOptions" = "lb_submit_grid_order_options_t"
116+
"CReplaceGridOrderOptions" = "lb_replace_grid_order_options_t"
117+
"CGetGridOrdersOptions" = "lb_get_grid_orders_options_t"
118+
"CGetGridOrdersByIdsOptions" = "lb_get_grid_orders_by_ids_options_t"
119+
"CGetGridOrderDetailOptions" = "lb_get_grid_order_detail_options_t"
120+
"CGetGridTriggerHistoryOptions" = "lb_get_grid_trigger_history_options_t"
121+
"CSubmitGridOrderResponse" = "lb_submit_grid_order_response_t"
122+
"CGridOrder" = "lb_grid_order_t"
123+
"CGridOrderSubOrder" = "lb_grid_order_sub_order_t"
124+
"CGridOrderHistory" = "lb_grid_order_history_t"
125+
"CGridOrderDetail" = "lb_grid_order_detail_t"
126+
"CTriggerOrder" = "lb_trigger_order_t"
127+
"CGridBidSize" = "lb_grid_bid_size_t"
128+
"CGridChannelInfo" = "lb_grid_channel_info_t"
129+
"CGridSymbolInfo" = "lb_grid_symbol_info_t"
130+
"CGridOrdersResponse" = "lb_grid_orders_response_t"
131+
"CGridTriggerHistoryResponse" = "lb_grid_trigger_history_response_t"
132+
"CPushGridOrderChanged" = "lb_push_grid_order_changed_t"
114133
"CEstimateMaxPurchaseQuantityOptions" = "lb_estimate_max_purchase_quantity_options_t"
115134
"CEstimateMaxPurchaseQuantityResponse" = "lb_estimate_max_purchase_quantity_response_t"
116135
"CCreateWatchlistGroup" = "lb_create_watchlist_group_t"
@@ -143,6 +162,7 @@ cpp_compat = true
143162
"CFundamentalContext" = "lb_fundamental_context_t"
144163
"CAlertContext" = "lb_alert_context_t"
145164
"CDCAContext" = "lb_dca_context_t"
165+
"CGridContext" = "lb_grid_context_t"
146166
"CSharelistContext" = "lb_sharelist_context_t"
147167
"CCalendarContext" = "lb_calendar_context_t"
148168
"CPortfolioContext" = "lb_portfolio_context_t"
@@ -408,6 +428,13 @@ include = [
408428
"CWatchlistSecurity",
409429
"CMarginRatio",
410430
"COrderDetail",
431+
# GridContext: grid trading (reachable only via void* async data pointer)
432+
"CSubmitGridOrderResponse",
433+
"CGridOrder", "CGridOrderSubOrder", "CGridOrderHistory", "CGridOrderDetail",
434+
"CTriggerOrder", "CGridBidSize", "CGridChannelInfo", "CGridSymbolInfo",
435+
"CGridOrdersResponse", "CGridTriggerHistoryResponse",
436+
# TradeContext: grid trading push (stays on trade side)
437+
"CPushGridOrderChanged",
411438
"CEstimateMaxPurchaseQuantityResponse",
412439
"CSecurityCalcIndex",
413440
"CWarrantInfo",

0 commit comments

Comments
 (0)