Skip to content

fix(ffi): add unified exports + SnapshotTradeTick plumbing to Go/C++ headers#239

Merged
userFRM merged 1 commit into
mainfrom
fix/ffi-unified-and-snapshot-trade
Apr 10, 2026
Merged

fix(ffi): add unified exports + SnapshotTradeTick plumbing to Go/C++ headers#239
userFRM merged 1 commit into
mainfrom
fix/ffi-unified-and-snapshot-trade

Conversation

@userFRM
Copy link
Copy Markdown
Owner

@userFRM userFRM commented Apr 10, 2026

Summary

  • fix(ffi): Go and C++ SDKs missing all 15 tdx_unified_* exports #216: Add all 19 tdx_unified_* C declarations and the TdxUnified opaque type to both sdks/go/ffi_bridge.h and sdks/cpp/include/thetadx.h. These match the Rust FFI exports that have existed since the unified client was introduced but were never declared in the SDK headers.
  • chore(cpp): dead TdxSnapshotTradeTick struct in C++ header #227: Add missing cOptionContract size assertion to Go init() checks (expected size: 32 bytes). TdxSnapshotTradeTickArray / tdx_free_snapshot_trade_tick_array are intentionally not added because the Rust FFI does not export them -- SnapshotTradeTick was removed from the FFI layer in v5.4.0; snapshot trade endpoints return TdxTradeTickArray.

Files changed

  • sdks/go/ffi_bridge.h -- TdxUnified opaque type + 19 unified function externs
  • sdks/cpp/include/thetadx.h -- TdxUnified opaque type + 19 unified function declarations with doc comments
  • sdks/go/client.go -- cOptionContract size assertion in init()

Test plan

  • cargo build --release -p thetadatadx-ffi --locked passes (no Rust changes)
  • Go SDK compiles with CGO against the updated header
  • C++ SDK compiles against the updated header

🤖 Generated with Claude Code

…headers (#216, #227)

Add all 19 tdx_unified_* C declarations (connect, start/stop streaming,
subscribe/unsubscribe quotes/trades/open_interest/full_trades/full_open_interest,
is_streaming, contract_lookup, active_subscriptions, next_event, historical,
free) plus the TdxUnified opaque type to both sdks/go/ffi_bridge.h and
sdks/cpp/include/thetadx.h.

Add missing cOptionContract size assertion to Go init() checks.

Note: TdxSnapshotTradeTickArray and tdx_free_snapshot_trade_tick_array are NOT
added because the Rust FFI does not export them -- SnapshotTradeTick was
intentionally removed from the FFI layer in v5.4.0 (snapshot trade endpoints
return TdxTradeTickArray). The C struct definition remains for documentation
but has no array/free plumbing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@userFRM userFRM merged commit f2c73bb into main Apr 10, 2026
36 of 37 checks passed
@userFRM userFRM deleted the fix/ffi-unified-and-snapshot-trade branch April 10, 2026 10:45
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