feat(config): add paper trading mode support across all SDK bindings#551
Open
sunli829 wants to merge 1 commit into
Open
feat(config): add paper trading mode support across all SDK bindings#551sunli829 wants to merge 1 commit into
sunli829 wants to merge 1 commit into
Conversation
Add LONGBRIDGE_PAPERTRADING env var and enable_papertrading() API to all language bindings (Rust, Python, Node.js, Java, C, C++). When enabled, the SDK declares the request targets the paper trading (simulation) environment; the server validates the token and returns an error if it belongs to a real-money account. Default is false — no restriction imposed by the server. - Rust: new field, env read, builder/setter methods, HTTP header injection, unit tests - Python: from_apikey/from_oauth new param, type stub updated - Node.js: ExtraConfigParams new field, apply_extra handler - C: lb_config_enable_papertrading() function, longbridge.h auto-updated - Java: JNI impl, SdkNative native method, Config.enablePapertrading() - C++: enable_papertrading() method in Config class - All READMEs: Paper Trading section and env var table entry added
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.
Summary
LONGBRIDGE_PAPERTRADINGenvironment variable andenable_papertrading()API to all language SDK bindings (Rust, Python, Node.js, Java, C, C++)true, the SDK declares the request targets the paper trading (simulation) environment; the server validates the token and returns an error if it belongs to a real-money accountfalse— no restriction imposed by the server, both paper trading and real-money accounts are acceptedChanges by language
enable_papertradingfield onConfig, env var read (LONGBRIDGE_PAPERTRADING),enable_papertrading()builder,set_enable_papertrading()setter, HTTP header injection, 2 unit testsfrom_apikey/from_oauthnewenable_papertradingparam, type stub (openapi.pyi) updatedExtraConfigParams.enablePapertradingfield,apply_extrahandlerlb_config_enable_papertrading()function;longbridge.hauto-updated via cbindgenSdkNative.configSetEnablePapertradingnative method,Config.enablePapertrading()chainable methodConfig::enable_papertrading()method in header and implementationTest plan
cargo clippy --all --all-features— no new errorscargo +nightly fmt --all— no formatting changescargo test -p longbridge enable_papertrading— 2 tests passcargo build -p longbridge-c— C header auto-updated withlb_config_enable_papertrading🤖 Generated with Claude Code