BinaryOptionsToolsV2 0.2.13__tar.gz → 0.2.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of BinaryOptionsToolsV2 might be problematic. Click here for more details.
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/__init__.py +65 -60
- binaryoptionstoolsv2-0.2.14/BinaryOptionsToolsV2/closeoption/__init__.py +13 -0
- binaryoptionstoolsv2-0.2.14/BinaryOptionsToolsV2/closeoption/asynchronous.py +313 -0
- binaryoptionstoolsv2-0.2.14/BinaryOptionsToolsV2/closeoption/synchronous.py +257 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +52 -7
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/synchronous.py +45 -18
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/Cargo.lock +184 -181
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/Cargo.toml +13 -11
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/PKG-INFO +55 -37
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/README.md +53 -36
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/.gitignore +4 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/Cargo.toml +14 -7
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/Readme.md +5 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/examples/pending_trades_example.rs +651 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/examples/test_demo.rs +114 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/mkds/README.md +94 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/client.rs +734 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/connect.rs +260 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/error.rs +95 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/mod.rs +9 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/state.rs +329 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/types.rs +386 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/utils.rs +323 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/lib.rs +84 -81
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/error.rs +4 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +67 -5
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +0 -12
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +37 -21
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/state.rs +18 -0
- binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/common/mod.rs +2 -3
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/comprehensive_pocketoption_tests.rs +847 -0
- {binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/modules/trades_tests → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/concurrency.rs +25 -2
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/deals_module_cleanup.rs +100 -0
- {binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/modules → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/deals_tests.rs +18 -21
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/history_verification_tests.rs +454 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/mod.rs +5 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/pending_trades_cleanup.rs +69 -0
- {binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/modules → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/pending_trades_tests.rs +25 -31
- {binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/modules → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/resilient_parsing_tests.rs +4 -5
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/test_ssid_debug.rs +11 -0
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/trade_state_regression.rs +72 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/Cargo.toml +3 -3
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/Readme.md +5 -0
- binaryoptionstoolsv2-0.2.14/crates/bindings_pyo3/src/closeoption.rs +258 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/error.rs +9 -1
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/lib.rs +4 -1
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/pocketoption.rs +31 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/Cargo.toml +1 -1
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/client.rs +1 -2
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/Cargo.toml +8 -8
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/pyproject.toml +1 -0
- binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +0 -2
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/config.py +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/tools/__init__.py +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/tools/login.py +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/tracing.py +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/validator.py +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/config.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/client.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/connect.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/state.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/types.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/framework/market.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/framework/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/framework/virtual_market.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/candle.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/connect.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/ssid.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/types.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/utils.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/build.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/config.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/framework.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/logs.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/runtime.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/README.md +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/diagrams/architecture.txt +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/diagrams/diagram.txt +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/docs/testing-framework.md +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/examples/echo_client.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/examples/middleware_example.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/examples/testing_echo_client.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/Cargo.toml +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/modules/lightweight.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/rule.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/builder.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/callback.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/connector.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/message.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/middleware.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/reimports.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/rules.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/signals.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/statistics.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/testing.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/time.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/tracing.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/middleware_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/rule_macro_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/runner_command_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/stream_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/testing_wrapper_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/two_step_standalone.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/ActionImpl_README.md +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/Cargo.lock +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/region.rs +0 -0
- {binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/timeout.rs +0 -0
{binaryoptionstoolsv2-0.2.13 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/__init__.py
RENAMED
|
@@ -1,60 +1,65 @@
|
|
|
1
|
-
import importlib
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
from .config import Config as Config
|
|
5
|
-
from . import tracing as tracing
|
|
6
|
-
from . import validator as validator
|
|
7
|
-
from .pocketoption import (
|
|
8
|
-
PocketOptionAsync as PocketOptionAsync,
|
|
9
|
-
PocketOption as PocketOption,
|
|
10
|
-
RawHandler as RawHandler,
|
|
11
|
-
Validator as Validator,
|
|
12
|
-
__all__ as __pocket_all__,
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
import importlib
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
from .config import Config as Config
|
|
5
|
+
from . import tracing as tracing
|
|
6
|
+
from . import validator as validator
|
|
7
|
+
from .pocketoption import (
|
|
8
|
+
PocketOptionAsync as PocketOptionAsync,
|
|
9
|
+
PocketOption as PocketOption,
|
|
10
|
+
RawHandler as RawHandler,
|
|
11
|
+
Validator as Validator,
|
|
12
|
+
__all__ as __pocket_all__,
|
|
13
|
+
)
|
|
14
|
+
from .closeoption import (
|
|
15
|
+
CloseOptionAsync as CloseOptionAsync,
|
|
16
|
+
CloseOption as CloseOption,
|
|
17
|
+
RawHandler as CloseRawHandler,
|
|
18
|
+
__all__ as __close_all__,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
# Import the Rust module and re-export its attributes
|
|
22
|
+
_rust_module = None
|
|
23
|
+
try:
|
|
24
|
+
_rust_module = importlib.import_module(".BinaryOptionsToolsV2", __package__)
|
|
25
|
+
except (ImportError, ValueError):
|
|
26
|
+
try:
|
|
27
|
+
_rust_module = importlib.import_module("BinaryOptionsToolsV2")
|
|
28
|
+
if _rust_module is sys.modules.get(__package__):
|
|
29
|
+
_rust_module = None
|
|
30
|
+
except ImportError:
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
if _rust_module is not None:
|
|
34
|
+
globals().update({k: v for k, v in _rust_module.__dict__.items() if not k.startswith("_")})
|
|
35
|
+
elif os.environ.get("PYTEST_CURRENT_TEST"):
|
|
36
|
+
print(f"[ERROR] Rust extension module not found (__package__={__package__})")
|
|
37
|
+
|
|
38
|
+
# Names expected from the Rust cdylib; only those actually loaded will be available
|
|
39
|
+
_rust_exported_names = [
|
|
40
|
+
"RawPocketOption",
|
|
41
|
+
"RawValidator",
|
|
42
|
+
"RawHandler",
|
|
43
|
+
"RawHandle",
|
|
44
|
+
"Logger",
|
|
45
|
+
"LogBuilder",
|
|
46
|
+
"PyConfig",
|
|
47
|
+
"PyBot",
|
|
48
|
+
"PyStrategy",
|
|
49
|
+
"PyContext",
|
|
50
|
+
"PyVirtualMarket",
|
|
51
|
+
"Action",
|
|
52
|
+
"StreamLogsIterator",
|
|
53
|
+
"StreamLogsLayer",
|
|
54
|
+
"StreamIterator",
|
|
55
|
+
]
|
|
56
|
+
__rust_all__ = [n for n in _rust_exported_names if n in globals()]
|
|
57
|
+
|
|
58
|
+
__all__ = list(
|
|
59
|
+
set(
|
|
60
|
+
__pocket_all__
|
|
61
|
+
+ __close_all__
|
|
62
|
+
+ ["tracing", "validator", "PocketOptionAsync", "PocketOption", "CloseOptionAsync", "CloseOption", "RawHandler", "Validator"]
|
|
63
|
+
+ __rust_all__
|
|
64
|
+
)
|
|
65
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from .asynchronous import CloseOptionAsync, AsyncSubscription, AsyncRawSubscription, RawHandler
|
|
2
|
+
from .synchronous import CloseOption, SyncSubscription, SyncRawSubscription, RawHandlerSync
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"CloseOptionAsync",
|
|
6
|
+
"CloseOption",
|
|
7
|
+
"AsyncSubscription",
|
|
8
|
+
"AsyncRawSubscription",
|
|
9
|
+
"SyncSubscription",
|
|
10
|
+
"SyncRawSubscription",
|
|
11
|
+
"RawHandler",
|
|
12
|
+
"RawHandlerSync",
|
|
13
|
+
]
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import json
|
|
3
|
+
import re
|
|
4
|
+
import sys
|
|
5
|
+
import warnings
|
|
6
|
+
from datetime import timedelta
|
|
7
|
+
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union, AsyncGenerator
|
|
8
|
+
|
|
9
|
+
from ..config import Config
|
|
10
|
+
from ..validator import Validator
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ..BinaryOptionsToolsV2 import Logger, RawCloseOption
|
|
14
|
+
|
|
15
|
+
if sys.version_info < (3, 10):
|
|
16
|
+
|
|
17
|
+
async def anext(iterator):
|
|
18
|
+
"""Polyfill for anext for Python < 3.10"""
|
|
19
|
+
return await iterator.__anext__()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AsyncSubscription:
|
|
23
|
+
def __init__(self, subscription):
|
|
24
|
+
"""Asynchronous Iterator over json objects"""
|
|
25
|
+
self.subscription = subscription
|
|
26
|
+
|
|
27
|
+
def __aiter__(self):
|
|
28
|
+
return self
|
|
29
|
+
|
|
30
|
+
async def __anext__(self):
|
|
31
|
+
return json.loads(await anext(self.subscription))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AsyncRawSubscription:
|
|
35
|
+
def __init__(self, subscription):
|
|
36
|
+
"""Asynchronous Iterator over raw messages"""
|
|
37
|
+
self.subscription = subscription
|
|
38
|
+
|
|
39
|
+
def __aiter__(self):
|
|
40
|
+
return self
|
|
41
|
+
|
|
42
|
+
async def __anext__(self):
|
|
43
|
+
return await anext(self.subscription)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class RawHandler:
|
|
47
|
+
"""
|
|
48
|
+
Asynchronous handler for advanced raw WebSocket message operations.
|
|
49
|
+
Provides low-level access to send custom messages and wait for specific responses.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
def __init__(self, handler):
|
|
53
|
+
self._handler = handler
|
|
54
|
+
|
|
55
|
+
async def send(self, message: str) -> None:
|
|
56
|
+
"""Send a raw message through the WebSocket connection."""
|
|
57
|
+
await self._handler.send(message)
|
|
58
|
+
|
|
59
|
+
async def wait_for(self, event: str, timeout: float = 30.0) -> dict:
|
|
60
|
+
"""Wait for a specific event from the server."""
|
|
61
|
+
return await self._handler.wait_for(event, timeout)
|
|
62
|
+
|
|
63
|
+
async def subscribe(self, event: str) -> AsyncRawSubscription:
|
|
64
|
+
"""Subscribe to a specific event type."""
|
|
65
|
+
sub = await self._handler.subscribe(event)
|
|
66
|
+
return AsyncRawSubscription(sub)
|
|
67
|
+
|
|
68
|
+
async def close(self) -> None:
|
|
69
|
+
"""Close the raw handler and release resources."""
|
|
70
|
+
if self._handler:
|
|
71
|
+
await self._handler.close()
|
|
72
|
+
self._handler = None # Release reference to allow Rust Drop
|
|
73
|
+
|
|
74
|
+
async def __aenter__(self):
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
78
|
+
await self.close()
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
|
|
82
|
+
"""Sanitize SSID format and validate session payload semantics."""
|
|
83
|
+
if not ssid or not isinstance(ssid, str):
|
|
84
|
+
raise ValueError("SSID must be a non-empty string")
|
|
85
|
+
|
|
86
|
+
ssid = ssid.strip()
|
|
87
|
+
|
|
88
|
+
# Try to parse as JSON first
|
|
89
|
+
if ssid.startswith('{') and ssid.endswith('}'):
|
|
90
|
+
try:
|
|
91
|
+
data = json.loads(ssid)
|
|
92
|
+
if isinstance(data, dict):
|
|
93
|
+
required = ['token', 'sid']
|
|
94
|
+
if all(k in data for k in required):
|
|
95
|
+
logger.debug("SSID parsed as JSON with token and sid")
|
|
96
|
+
return ssid
|
|
97
|
+
except json.JSONDecodeError:
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
# Try pipe-delimited format: token|sid|demo|public_code|hidden_code
|
|
101
|
+
parts = ssid.split('|')
|
|
102
|
+
if len(parts) >= 3:
|
|
103
|
+
logger.debug(f"SSID parsed as pipe-delimited with {len(parts)} parts")
|
|
104
|
+
return ssid
|
|
105
|
+
|
|
106
|
+
# If it's just a token, assume it's a simple token
|
|
107
|
+
logger.warning("SSID format not recognized, using as-is")
|
|
108
|
+
return ssid
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def parse_ssid(ssid: str) -> Tuple[str, str, bool, str, str]:
|
|
112
|
+
"""Parse SSID into token, sid, demo, public_code, hidden_code."""
|
|
113
|
+
# Try JSON first
|
|
114
|
+
if ssid.startswith('{') and ssid.endswith('}'):
|
|
115
|
+
try:
|
|
116
|
+
data = json.loads(ssid)
|
|
117
|
+
if isinstance(data, dict):
|
|
118
|
+
token = data.get('token', '')
|
|
119
|
+
sid = data.get('sid', '')
|
|
120
|
+
demo = data.get('demo', False)
|
|
121
|
+
public_code = data.get('public_code', '')
|
|
122
|
+
hidden_code = data.get('hidden_code', '')
|
|
123
|
+
return token, sid, demo, public_code, hidden_code
|
|
124
|
+
except json.JSONDecodeError:
|
|
125
|
+
pass
|
|
126
|
+
|
|
127
|
+
# Try pipe-delimited
|
|
128
|
+
parts = ssid.split('|')
|
|
129
|
+
if len(parts) >= 3:
|
|
130
|
+
token = parts[0]
|
|
131
|
+
sid = parts[1]
|
|
132
|
+
demo = parts[2].lower() in ('true', '1', 'yes', 'demo') if len(parts) > 2 else False
|
|
133
|
+
public_code = parts[3] if len(parts) > 3 else ''
|
|
134
|
+
hidden_code = parts[4] if len(parts) > 4 else ''
|
|
135
|
+
return token, sid, demo, public_code, hidden_code
|
|
136
|
+
|
|
137
|
+
# Fallback: treat as token only
|
|
138
|
+
return ssid, '', False, '', ''
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# This file contains all the async code for the CloseOption Module
|
|
142
|
+
class CloseOptionAsync:
|
|
143
|
+
def __init__(self, ssid: str, url: Optional[str] = None, config: Optional[Union[Config, dict, str]] = None, **_):
|
|
144
|
+
"""
|
|
145
|
+
Initialize CloseOption async client.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
ssid: Session ID in format "token|sid|demo|public_code|hidden_code" or JSON
|
|
149
|
+
url: WebSocket URL (optional, defaults to CloseOption)
|
|
150
|
+
config: Configuration object (optional)
|
|
151
|
+
"""
|
|
152
|
+
self._ssid = ssid
|
|
153
|
+
self._url = url
|
|
154
|
+
self._config = config if isinstance(config, Config) else Config(config) if config else Config()
|
|
155
|
+
self._validator = Validator()
|
|
156
|
+
self._client = None
|
|
157
|
+
self._raw_handler = None
|
|
158
|
+
self._connected = False
|
|
159
|
+
|
|
160
|
+
async def __aenter__(self):
|
|
161
|
+
await self.connect()
|
|
162
|
+
return self
|
|
163
|
+
|
|
164
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
165
|
+
await self.shutdown()
|
|
166
|
+
|
|
167
|
+
async def connect(self) -> None:
|
|
168
|
+
"""Establish connection to CloseOption."""
|
|
169
|
+
if self._connected:
|
|
170
|
+
return
|
|
171
|
+
|
|
172
|
+
from ..BinaryOptionsToolsV2 import RawCloseOption, Logger
|
|
173
|
+
|
|
174
|
+
logger = Logger()
|
|
175
|
+
ssid = sanitize_and_validate_ssid(self._ssid, logger)
|
|
176
|
+
token, sid, demo, public_code, hidden_code = parse_ssid(ssid)
|
|
177
|
+
|
|
178
|
+
if not token or not sid:
|
|
179
|
+
raise ValueError("SSID must contain token and sid")
|
|
180
|
+
|
|
181
|
+
if not public_code or not hidden_code:
|
|
182
|
+
raise ValueError("SSID must contain public_code and hidden_code (format: token|sid|demo|public_code|hidden_code)")
|
|
183
|
+
|
|
184
|
+
# Build URL with sid
|
|
185
|
+
if self._url:
|
|
186
|
+
ws_url = self._url
|
|
187
|
+
else:
|
|
188
|
+
ws_url = f"wss://www.closeoption.com:8443/socket.io/?EIO=3&transport=websocket&sid={sid}"
|
|
189
|
+
|
|
190
|
+
self._client = RawCloseOption(token, sid, public_code, hidden_code, demo, ws_url, self._config.pyconfig)
|
|
191
|
+
await self._client.connect()
|
|
192
|
+
self._connected = True
|
|
193
|
+
|
|
194
|
+
async def _ensure_connected(self):
|
|
195
|
+
if not self._connected:
|
|
196
|
+
await self.connect()
|
|
197
|
+
|
|
198
|
+
async def buy(self, asset: str, amount: float, time: int) -> dict:
|
|
199
|
+
"""Place a BUY (CALL) order."""
|
|
200
|
+
await self._ensure_connected()
|
|
201
|
+
result = await self._client.buy(asset, amount, time)
|
|
202
|
+
return json.loads(result)
|
|
203
|
+
|
|
204
|
+
async def sell(self, asset: str, amount: float, time: int) -> dict:
|
|
205
|
+
"""Place a SELL (PUT) order."""
|
|
206
|
+
await self._ensure_connected()
|
|
207
|
+
result = await self._client.sell(asset, amount, time)
|
|
208
|
+
return json.loads(result)
|
|
209
|
+
|
|
210
|
+
async def check_win(self, order_id: str) -> dict:
|
|
211
|
+
"""Check the result of a trade."""
|
|
212
|
+
await self._ensure_connected()
|
|
213
|
+
result = await self._client.check_win(order_id)
|
|
214
|
+
return json.loads(result)
|
|
215
|
+
|
|
216
|
+
async def balance(self) -> float:
|
|
217
|
+
"""Get current balance."""
|
|
218
|
+
await self._ensure_connected()
|
|
219
|
+
result = await self._client.balance()
|
|
220
|
+
return float(result) if result else 0.0
|
|
221
|
+
|
|
222
|
+
async def candles(self, asset: str, period: int) -> List[dict]:
|
|
223
|
+
"""Get historical candles."""
|
|
224
|
+
await self._ensure_connected()
|
|
225
|
+
result = await self._client.candles(asset, period)
|
|
226
|
+
return json.loads(result)
|
|
227
|
+
|
|
228
|
+
async def get_candles(self, asset: str, period: int, count: int = 100) -> List[dict]:
|
|
229
|
+
"""Get historical candles with count."""
|
|
230
|
+
await self._ensure_connected()
|
|
231
|
+
result = await self._client.get_candles(asset, period, count)
|
|
232
|
+
return json.loads(result)
|
|
233
|
+
|
|
234
|
+
async def get_candles_live(self, asset: str, period: int) -> AsyncGenerator[dict, None]:
|
|
235
|
+
"""Get live candle updates."""
|
|
236
|
+
await self._ensure_connected()
|
|
237
|
+
async for candle in self._client.get_candles_live(asset, period):
|
|
238
|
+
yield json.loads(candle)
|
|
239
|
+
|
|
240
|
+
async def subscribe_symbol(self, symbol: str) -> AsyncSubscription:
|
|
241
|
+
"""Subscribe to price updates for a symbol."""
|
|
242
|
+
await self._ensure_connected()
|
|
243
|
+
sub = await self._client.subscribe_symbol(symbol)
|
|
244
|
+
return AsyncSubscription(sub)
|
|
245
|
+
|
|
246
|
+
async def subscribe_raw(self) -> AsyncRawSubscription:
|
|
247
|
+
"""Subscribe to all raw messages."""
|
|
248
|
+
await self._ensure_connected()
|
|
249
|
+
sub = await self._client.subscribe_raw()
|
|
250
|
+
return AsyncRawSubscription(sub)
|
|
251
|
+
|
|
252
|
+
async def send_raw(self, message: str) -> None:
|
|
253
|
+
"""Send a raw message."""
|
|
254
|
+
await self._ensure_connected()
|
|
255
|
+
await self._client.send_raw(message)
|
|
256
|
+
|
|
257
|
+
async def active_assets(self) -> List[dict]:
|
|
258
|
+
"""Get list of active assets."""
|
|
259
|
+
await self._ensure_connected()
|
|
260
|
+
result = await self._client.active_assets()
|
|
261
|
+
return json.loads(result)
|
|
262
|
+
|
|
263
|
+
async def payout(self, asset: str) -> float:
|
|
264
|
+
"""Get payout for an asset."""
|
|
265
|
+
await self._ensure_connected()
|
|
266
|
+
result = await self._client.payout(asset)
|
|
267
|
+
return float(result)
|
|
268
|
+
|
|
269
|
+
async def history(self, limit: int = 100) -> List[dict]:
|
|
270
|
+
"""Get trade history."""
|
|
271
|
+
await self._ensure_connected()
|
|
272
|
+
result = await self._client.history(limit)
|
|
273
|
+
return json.loads(result)
|
|
274
|
+
|
|
275
|
+
async def opened_deals(self) -> List[dict]:
|
|
276
|
+
"""Get opened deals."""
|
|
277
|
+
await self._ensure_connected()
|
|
278
|
+
result = await self._client.opened_deals()
|
|
279
|
+
return json.loads(result)
|
|
280
|
+
|
|
281
|
+
async def closed_deals(self) -> List[dict]:
|
|
282
|
+
"""Get closed deals."""
|
|
283
|
+
await self._ensure_connected()
|
|
284
|
+
result = await self._client.closed_deals()
|
|
285
|
+
return json.loads(result)
|
|
286
|
+
|
|
287
|
+
async def get_server_time(self) -> int:
|
|
288
|
+
"""Get server time."""
|
|
289
|
+
await self._ensure_connected()
|
|
290
|
+
result = await self._client.get_server_time()
|
|
291
|
+
return int(result)
|
|
292
|
+
|
|
293
|
+
async def raw_handler(self) -> RawHandler:
|
|
294
|
+
"""Get raw handler for advanced operations."""
|
|
295
|
+
await self._ensure_connected()
|
|
296
|
+
if self._raw_handler is None:
|
|
297
|
+
handler = await self._client.raw_handler()
|
|
298
|
+
self._raw_handler = RawHandler(handler)
|
|
299
|
+
return self._raw_handler
|
|
300
|
+
|
|
301
|
+
async def shutdown(self) -> None:
|
|
302
|
+
"""Close the connection and cleanup."""
|
|
303
|
+
if self._raw_handler:
|
|
304
|
+
await self._raw_handler.close()
|
|
305
|
+
self._raw_handler = None
|
|
306
|
+
if self._client:
|
|
307
|
+
await self._client.shutdown()
|
|
308
|
+
self._client = None
|
|
309
|
+
self._connected = False
|
|
310
|
+
|
|
311
|
+
async def reconnect(self) -> None:
|
|
312
|
+
"""Reconnect to the server."""
|
|
313
|
+
await self._client.reconnect()
|