Skip to content

feat(asset): expose bind_fail_reason on BankCard and the decision times on StockTransferIn - #642

Merged
hogan-yuan merged 2 commits into
mainfrom
feat/asset-missing-fields
Dec 3, 2026
Merged

hogan-yuan merged 2 commits into
mainfrom
feat/asset-missing-fields

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

GET /v2/account/bank-cards returns bind_fail_reason and GET /v1/account/stock-transfers/in returns agree_at, refuse_at and cancel_at, but the SDK dropped them (StockTransferOut already had the three times). Found while moving the Longbridge MCP server's account tools onto AssetContext (longbridge/longbridge-mcp#221): bank_cards and stock_transfers_in had to stay on raw gateway calls because of these gaps.

  • All SDKs: BankCard.bind_fail_reason (empty unless binding failed) and StockTransferIn.agree_at / refuse_at / cancel_at. The times decode like the other transfer times: placeholders (0, 1970, negative values) are None.
  • C: lb_bank_card_t.bind_fail_reason and lb_stock_transfer_in_t.agree_at / refuse_at / cancel_at, appended as the last members so existing offsets are unchanged. longbridge.h regenerated by cbindgen (only these members change).
  • C++, Java (getBindFailReason(), getAgreeAt() …), Node.js (bindFailReason, agreeAt …) and Python (stub updated): the same fields.

Coupon.fund_interest is still not modelled: the server does not document it and every sample seen so far is null.

Test plan

  • cargo test -p longbridge --lib (bank card and transfer-in decode tests cover the new fields)
  • cargo clippy --workspace --all-targets: no new warnings
  • C++ asset_context.cpp syntax check, javac on the changed classes

🤖 Generated with Claude Code

…es on StockTransferIn

GET /v2/account/bank-cards returns bind_fail_reason and GET
/v1/account/stock-transfers/in returns agree_at, refuse_at and cancel_at
(StockTransferOut already had them), but the SDK dropped them. Add them to
every SDK; the C members are appended so existing offsets are unchanged.
@hogan-yuan
hogan-yuan merged commit 5a0a95c into main Dec 3, 2026
2 of 6 checks passed
@hogan-yuan
hogan-yuan deleted the feat/asset-missing-fields branch December 3, 2026 08:58
@hogan-yuan hogan-yuan mentioned this pull request Dec 4, 2026
hogan-yuan added a commit that referenced this pull request Dec 4, 2026
Bumps all crates to 5.7.0 and moves `## [Unreleased]` to `## [5.7.0] -
2026-12-04`. Also adds the missing changelog entry for #643.

Minor bump: new fields (#642), the HK signals refusal and new path
validation in the HTTP client (#645), and a deprecation (#646). Nothing
removed.

```
#646 chore: deprecate industry_valuation_dist
#645 feat(signal): refuse signals for Longbridge Hong Kong accounts
#642 feat(asset): expose bind_fail_reason on BankCard and the decision times on StockTransferIn
#644 fix(asset): list every stock transfer state when no state filter is given
#643 fix(httpclient): leave X-Api-Key out when an OAuth client has no client ID
```

After merge: push `main` to `release` to publish (crates.io, PyPI, npm,
Maven, C++), then tag `v5.7.0` and publish the GitHub release.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
hogan-yuan added a commit to longbridge/longbridge-mcp that referenced this pull request Dec 4, 2026
…221)

Moves the account tools onto the Rust SDK 5.6's typed `AssetContext`
instead of raw gateway calls. Tool output is unchanged except for
`coupons` (below) — each other tool has a golden test comparing the old
and new paths on the same upstream response.

- **Via the SDK:** `edda_authorizations`, `edda_status`,
`stock_transfers_out`, `withdrawals` (incl. the bank-name lookup),
`deposits`, `reward_records`, `coupons`, `coupon_orders`.
- **Still raw**, until longbridge/openapi#642 ships the fields they
output: `bank_cards` (`bind_fail_reason`), `stock_transfers_in`
(`agree_at` / `refuse_at` / `cancel_at`, which `days_in_process` also
uses).
- **`coupons`:** cannot match the raw path byte for byte, because that
path passed upstream's mixed wire formats through. Its golden test pins
the reviewed SDK output instead. Differences: int64 strings come out as
numbers and decimals as text; enum names as the server's codes (so
commission `targets` now names every type); `"0"` placeholder times are
omitted; the undocumented `fund_interest` (null in every reply seen) is
no longer listed; a term the server omits comes back as the SDK's
default.
- **Edge-case differences:** an undocumented state code in
`deposits.states` / `stock_transfers_out.state` is now rejected instead
of sent upstream; `0` placeholder times are omitted; `account_balance`
keeps its output by not exposing 5.6's new `redemption_cash`.

Tests: `cargo test --all-features` (627 passed), clippy clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant