binaryoptionstoolsv2 0.2.14__tar.gz → 0.2.15__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.
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/__init__.py +11 -2
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/closeoption/__init__.py +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/closeoption/asynchronous.py +30 -16
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/closeoption/synchronous.py +92 -19
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/config.py +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +7 -9
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/pocketoption/synchronous.py +4 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/Cargo.lock +224 -237
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/PKG-INFO +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/Cargo.toml +2 -2
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/closeoption/client.rs +292 -72
- binaryoptionstoolsv2-0.2.15/crates/binary_options_tools/src/closeoption/connect.rs +565 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/closeoption/error.rs +6 -2
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/closeoption/mod.rs +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/closeoption/state.rs +23 -11
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/closeoption/types.rs +67 -32
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/closeoption/utils.rs +113 -43
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/lib.rs +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/candle.rs +3 -6
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/connect.rs +7 -5
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/error.rs +1 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +10 -5
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +2 -2
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +5 -5
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +26 -15
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/state.rs +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/types.rs +3 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/utils.rs +126 -53
- binaryoptionstoolsv2-0.2.15/crates/binary_options_tools/tests/closeoption_test.rs +198 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/common/mod.rs +9 -47
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/comprehensive_pocketoption_tests.rs +0 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/concurrency.rs +1 -20
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/deals_module_cleanup.rs +6 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/deals_tests.rs +14 -14
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/history_verification_tests.rs +10 -5
- binaryoptionstoolsv2-0.2.15/crates/binary_options_tools/tests/pending_trades_tests.rs +1135 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/Cargo.toml +2 -2
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/closeoption.rs +32 -10
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/Cargo.toml +1 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/client.rs +2 -4
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/tests/runner_command_tests.rs +3 -1
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/Cargo.toml +1 -1
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/connect.rs +0 -260
- binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/pending_trades_tests.rs +0 -1152
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/pocketoption/tools/__init__.py +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/pocketoption/tools/login.py +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/tracing.py +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/validator.py +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/Cargo.toml +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/README.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/Readme.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/examples/pending_trades_example.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/examples/test_demo.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/mkds/README.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/config.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/client.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/connect.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/state.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/expertoptions/types.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/framework/market.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/framework/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/framework/virtual_market.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/pocketoption/ssid.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/pending_trades_cleanup.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/resilient_parsing_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/test_ssid_debug.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/binary_options_tools/tests/trade_state_regression.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/Readme.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/build.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/config.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/framework.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/logs.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/pocketoption.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/runtime.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/bindings_pyo3/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/README.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/diagrams/architecture.txt +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/diagrams/diagram.txt +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/docs/testing-framework.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/examples/echo_client.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/examples/middleware_example.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/examples/testing_echo_client.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/macros/Cargo.toml +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/macros/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/macros/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/macros/src/modules/lightweight.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/macros/src/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/macros/src/rule.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/builder.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/callback.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/connector.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/message.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/middleware.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/reimports.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/rules.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/signals.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/statistics.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/testing.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/utils/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/utils/time.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/src/utils/tracing.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/tests/middleware_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/tests/rule_macro_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/tests/stream_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/tests/testing_wrapper_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/core/tests/two_step_standalone.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/ActionImpl_README.md +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/Cargo.lock +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/src/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/src/region.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/crates/macros/src/timeout.rs +0 -0
- {binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/pyproject.toml +0 -0
{binaryoptionstoolsv2-0.2.14 → binaryoptionstoolsv2-0.2.15}/BinaryOptionsToolsV2/__init__.py
RENAMED
|
@@ -59,7 +59,16 @@ __all__ = list(
|
|
|
59
59
|
set(
|
|
60
60
|
__pocket_all__
|
|
61
61
|
+ __close_all__
|
|
62
|
-
+ [
|
|
62
|
+
+ [
|
|
63
|
+
"tracing",
|
|
64
|
+
"validator",
|
|
65
|
+
"PocketOptionAsync",
|
|
66
|
+
"PocketOption",
|
|
67
|
+
"CloseOptionAsync",
|
|
68
|
+
"CloseOption",
|
|
69
|
+
"RawHandler",
|
|
70
|
+
"Validator",
|
|
71
|
+
]
|
|
63
72
|
+ __rust_all__
|
|
64
73
|
)
|
|
65
|
-
)
|
|
74
|
+
)
|
|
@@ -86,11 +86,11 @@ def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
|
|
|
86
86
|
ssid = ssid.strip()
|
|
87
87
|
|
|
88
88
|
# Try to parse as JSON first
|
|
89
|
-
if ssid.startswith(
|
|
89
|
+
if ssid.startswith("{") and ssid.endswith("}"):
|
|
90
90
|
try:
|
|
91
91
|
data = json.loads(ssid)
|
|
92
92
|
if isinstance(data, dict):
|
|
93
|
-
required = [
|
|
93
|
+
required = ["token", "sid"]
|
|
94
94
|
if all(k in data for k in required):
|
|
95
95
|
logger.debug("SSID parsed as JSON with token and sid")
|
|
96
96
|
return ssid
|
|
@@ -98,7 +98,7 @@ def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
|
|
|
98
98
|
pass
|
|
99
99
|
|
|
100
100
|
# Try pipe-delimited format: token|sid|demo|public_code|hidden_code
|
|
101
|
-
parts = ssid.split(
|
|
101
|
+
parts = ssid.split("|")
|
|
102
102
|
if len(parts) >= 3:
|
|
103
103
|
logger.debug(f"SSID parsed as pipe-delimited with {len(parts)} parts")
|
|
104
104
|
return ssid
|
|
@@ -111,31 +111,31 @@ def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
|
|
|
111
111
|
def parse_ssid(ssid: str) -> Tuple[str, str, bool, str, str]:
|
|
112
112
|
"""Parse SSID into token, sid, demo, public_code, hidden_code."""
|
|
113
113
|
# Try JSON first
|
|
114
|
-
if ssid.startswith(
|
|
114
|
+
if ssid.startswith("{") and ssid.endswith("}"):
|
|
115
115
|
try:
|
|
116
116
|
data = json.loads(ssid)
|
|
117
117
|
if isinstance(data, dict):
|
|
118
|
-
token = data.get(
|
|
119
|
-
sid = data.get(
|
|
120
|
-
demo = data.get(
|
|
121
|
-
public_code = data.get(
|
|
122
|
-
hidden_code = data.get(
|
|
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
123
|
return token, sid, demo, public_code, hidden_code
|
|
124
124
|
except json.JSONDecodeError:
|
|
125
125
|
pass
|
|
126
126
|
|
|
127
127
|
# Try pipe-delimited
|
|
128
|
-
parts = ssid.split(
|
|
128
|
+
parts = ssid.split("|")
|
|
129
129
|
if len(parts) >= 3:
|
|
130
130
|
token = parts[0]
|
|
131
131
|
sid = parts[1]
|
|
132
|
-
demo = parts[2].lower() in (
|
|
133
|
-
public_code = parts[3] if len(parts) > 3 else
|
|
134
|
-
hidden_code = parts[4] if len(parts) > 4 else
|
|
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
135
|
return token, sid, demo, public_code, hidden_code
|
|
136
136
|
|
|
137
137
|
# Fallback: treat as token only
|
|
138
|
-
return ssid,
|
|
138
|
+
return ssid, "", False, "", ""
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
# This file contains all the async code for the CloseOption Module
|
|
@@ -157,6 +157,11 @@ class CloseOptionAsync:
|
|
|
157
157
|
self._raw_handler = None
|
|
158
158
|
self._connected = False
|
|
159
159
|
|
|
160
|
+
@property
|
|
161
|
+
def is_connected(self) -> bool:
|
|
162
|
+
"""Whether the connection to CloseOption has been established."""
|
|
163
|
+
return self._connected
|
|
164
|
+
|
|
160
165
|
async def __aenter__(self):
|
|
161
166
|
await self.connect()
|
|
162
167
|
return self
|
|
@@ -179,7 +184,9 @@ class CloseOptionAsync:
|
|
|
179
184
|
raise ValueError("SSID must contain token and sid")
|
|
180
185
|
|
|
181
186
|
if not public_code or not hidden_code:
|
|
182
|
-
raise ValueError(
|
|
187
|
+
raise ValueError(
|
|
188
|
+
"SSID must contain public_code and hidden_code (format: token|sid|demo|public_code|hidden_code)"
|
|
189
|
+
)
|
|
183
190
|
|
|
184
191
|
# Build URL with sid
|
|
185
192
|
if self._url:
|
|
@@ -187,8 +194,9 @@ class CloseOptionAsync:
|
|
|
187
194
|
else:
|
|
188
195
|
ws_url = f"wss://www.closeoption.com:8443/socket.io/?EIO=3&transport=websocket&sid={sid}"
|
|
189
196
|
|
|
197
|
+
logger.info("CloseOption: connecting to WebSocket")
|
|
190
198
|
self._client = RawCloseOption(token, sid, public_code, hidden_code, demo, ws_url, self._config.pyconfig)
|
|
191
|
-
|
|
199
|
+
logger.info("CloseOption: WebSocket connection established")
|
|
192
200
|
self._connected = True
|
|
193
201
|
|
|
194
202
|
async def _ensure_connected(self):
|
|
@@ -231,6 +239,12 @@ class CloseOptionAsync:
|
|
|
231
239
|
result = await self._client.get_candles(asset, period, count)
|
|
232
240
|
return json.loads(result)
|
|
233
241
|
|
|
242
|
+
async def get_ticks(self, asset: str) -> List[dict]:
|
|
243
|
+
"""Get tick series for an asset."""
|
|
244
|
+
await self._ensure_connected()
|
|
245
|
+
result = await self._client.get_ticks(asset)
|
|
246
|
+
return json.loads(result)
|
|
247
|
+
|
|
234
248
|
async def get_candles_live(self, asset: str, period: int) -> AsyncGenerator[dict, None]:
|
|
235
249
|
"""Get live candle updates."""
|
|
236
250
|
await self._ensure_connected()
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import json
|
|
3
2
|
import threading
|
|
4
3
|
import sys
|
|
5
|
-
import
|
|
6
|
-
from
|
|
7
|
-
from typing import Dict, List, Optional, Tuple, Union
|
|
4
|
+
import concurrent.futures
|
|
5
|
+
from typing import List, Optional, Union
|
|
8
6
|
from ..config import Config
|
|
9
7
|
from ..validator import Validator as Validator
|
|
10
8
|
from .asynchronous import CloseOptionAsync as CloseOptionAsync
|
|
11
9
|
|
|
12
10
|
if sys.version_info < (3, 10):
|
|
11
|
+
|
|
13
12
|
async def anext(iterator):
|
|
14
13
|
"""Polyfill for anext for Python < 3.10"""
|
|
15
14
|
return await iterator.__anext__()
|
|
@@ -29,9 +28,7 @@ class SyncSubscription:
|
|
|
29
28
|
|
|
30
29
|
def __next__(self):
|
|
31
30
|
if self._loop is not None and self._loop.is_running():
|
|
32
|
-
future = asyncio.run_coroutine_threadsafe(
|
|
33
|
-
anext(self.subscription), self._loop
|
|
34
|
-
)
|
|
31
|
+
future = asyncio.run_coroutine_threadsafe(anext(self.subscription), self._loop)
|
|
35
32
|
try:
|
|
36
33
|
return future.result()
|
|
37
34
|
except StopAsyncIteration:
|
|
@@ -48,9 +45,7 @@ class SyncCandleLiveIterator:
|
|
|
48
45
|
return self
|
|
49
46
|
|
|
50
47
|
def __next__(self):
|
|
51
|
-
future = asyncio.run_coroutine_threadsafe(
|
|
52
|
-
self._get_next(), self.loop
|
|
53
|
-
)
|
|
48
|
+
future = asyncio.run_coroutine_threadsafe(self._get_next(), self.loop)
|
|
54
49
|
try:
|
|
55
50
|
return future.result()
|
|
56
51
|
except StopAsyncIteration:
|
|
@@ -60,7 +55,6 @@ class SyncCandleLiveIterator:
|
|
|
60
55
|
return await anext(self.async_gen)
|
|
61
56
|
|
|
62
57
|
|
|
63
|
-
|
|
64
58
|
class RawHandlerSync:
|
|
65
59
|
"""Synchronous handler for advanced raw WebSocket message operations."""
|
|
66
60
|
|
|
@@ -86,7 +80,7 @@ class RawHandlerSync:
|
|
|
86
80
|
"""Wait for a specific event from the server."""
|
|
87
81
|
return self._run(self._handler.wait_for(event, timeout))
|
|
88
82
|
|
|
89
|
-
def subscribe(self, event: str) ->
|
|
83
|
+
def subscribe(self, event: str) -> "SyncRawSubscription":
|
|
90
84
|
"""Subscribe to a specific event type."""
|
|
91
85
|
sub = self._run(self._handler.subscribe(event))
|
|
92
86
|
return SyncRawSubscription(sub)
|
|
@@ -120,9 +114,7 @@ class SyncRawSubscription:
|
|
|
120
114
|
|
|
121
115
|
def __next__(self):
|
|
122
116
|
if self._loop is not None and self._loop.is_running():
|
|
123
|
-
future = asyncio.run_coroutine_threadsafe(
|
|
124
|
-
anext(self.subscription), self._loop
|
|
125
|
-
)
|
|
117
|
+
future = asyncio.run_coroutine_threadsafe(anext(self.subscription), self._loop)
|
|
126
118
|
try:
|
|
127
119
|
return future.result()
|
|
128
120
|
except StopAsyncIteration:
|
|
@@ -131,7 +123,14 @@ class SyncRawSubscription:
|
|
|
131
123
|
|
|
132
124
|
|
|
133
125
|
class CloseOption:
|
|
134
|
-
def __init__(
|
|
126
|
+
def __init__(
|
|
127
|
+
self,
|
|
128
|
+
ssid: str,
|
|
129
|
+
url: Optional[str] = None,
|
|
130
|
+
config: Union[Config, dict, str] = None,
|
|
131
|
+
connect_on_init: bool = True,
|
|
132
|
+
**_,
|
|
133
|
+
):
|
|
135
134
|
"""
|
|
136
135
|
Initialize CloseOption synchronous client.
|
|
137
136
|
|
|
@@ -139,6 +138,9 @@ class CloseOption:
|
|
|
139
138
|
ssid: Session ID in format "token|sid|demo|public_code|hidden_code" or JSON
|
|
140
139
|
url: WebSocket URL (optional, defaults to CloseOption)
|
|
141
140
|
config: Configuration object (optional)
|
|
141
|
+
connect_on_init: Whether to establish the connection eagerly in the
|
|
142
|
+
constructor (default True). Set to False to inspect the client
|
|
143
|
+
API without connecting (e.g. offline demo mode).
|
|
142
144
|
"""
|
|
143
145
|
self._ssid = ssid
|
|
144
146
|
self._url = url
|
|
@@ -155,16 +157,59 @@ class CloseOption:
|
|
|
155
157
|
self._thread = threading.Thread(target=self._run_loop, daemon=True)
|
|
156
158
|
self._thread.start()
|
|
157
159
|
self._closed = False
|
|
160
|
+
if connect_on_init:
|
|
161
|
+
# Establish the connection eagerly so the constructor fails fast on bad
|
|
162
|
+
# credentials and later operations don't race an implicit first connect.
|
|
163
|
+
try:
|
|
164
|
+
self._connect()
|
|
165
|
+
except Exception:
|
|
166
|
+
# Stop the background loop and join its thread before propagating
|
|
167
|
+
# so a failed construction leaves no orphaned thread behind.
|
|
168
|
+
try:
|
|
169
|
+
self.shutdown()
|
|
170
|
+
except Exception:
|
|
171
|
+
pass
|
|
172
|
+
raise
|
|
173
|
+
|
|
158
174
|
def _run_loop(self):
|
|
159
175
|
asyncio.set_event_loop(self._loop)
|
|
160
176
|
self._loop.run_forever()
|
|
161
177
|
|
|
162
178
|
def _run(self, coro):
|
|
179
|
+
"""Run a coroutine on the background loop and block for its result.
|
|
180
|
+
|
|
181
|
+
No timeout is applied here: operation futures (buy/sell/check_win/...)
|
|
182
|
+
only resolve once the underlying RawCloseOption action has finished (or
|
|
183
|
+
raised), so a retry can never re-issue an order that already went
|
|
184
|
+
through. connection_initialization_timeout_secs is applied only by
|
|
185
|
+
_connect()/_ensure_connected() while establishing the connection.
|
|
186
|
+
"""
|
|
163
187
|
future = asyncio.run_coroutine_threadsafe(coro, self._loop)
|
|
164
188
|
return future.result()
|
|
165
189
|
|
|
190
|
+
def _connect(self):
|
|
191
|
+
"""Establish the connection, bounded by the connection initialization
|
|
192
|
+
timeout. CloseOptionAsync.connect() is a no-op once connected."""
|
|
193
|
+
future = asyncio.run_coroutine_threadsafe(self._async_client.connect(), self._loop)
|
|
194
|
+
try:
|
|
195
|
+
return future.result(timeout=self._config.connection_initialization_timeout_secs)
|
|
196
|
+
except concurrent.futures.TimeoutError as exc:
|
|
197
|
+
future.cancel()
|
|
198
|
+
raise TimeoutError("CloseOption connection timed out") from exc
|
|
199
|
+
|
|
200
|
+
def _ensure_connected(self):
|
|
201
|
+
"""Connect on demand through the bounded _connect() path.
|
|
202
|
+
|
|
203
|
+
Used for deferred connections (e.g. connect_on_init=False): without this,
|
|
204
|
+
the async client would connect lazily inside the operation coroutine,
|
|
205
|
+
bypassing the Python-side connection initialization timeout.
|
|
206
|
+
"""
|
|
207
|
+
if self._async_client is not None and not self._async_client.is_connected:
|
|
208
|
+
self._connect()
|
|
209
|
+
|
|
166
210
|
def __enter__(self):
|
|
167
|
-
|
|
211
|
+
# Connection is established in __init__; no per-operation timeout applies.
|
|
212
|
+
print("CloseOption: connected")
|
|
168
213
|
return self
|
|
169
214
|
|
|
170
215
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
@@ -172,73 +217,95 @@ class CloseOption:
|
|
|
172
217
|
|
|
173
218
|
def buy(self, asset: str, amount: float, time: int) -> dict:
|
|
174
219
|
"""Place a BUY (CALL) order."""
|
|
220
|
+
self._ensure_connected()
|
|
175
221
|
return self._run(self._async_client.buy(asset, amount, time))
|
|
176
222
|
|
|
177
223
|
def sell(self, asset: str, amount: float, time: int) -> dict:
|
|
178
224
|
"""Place a SELL (PUT) order."""
|
|
225
|
+
self._ensure_connected()
|
|
179
226
|
return self._run(self._async_client.sell(asset, amount, time))
|
|
180
227
|
|
|
181
228
|
def check_win(self, order_id: str) -> dict:
|
|
182
229
|
"""Check the result of a trade."""
|
|
230
|
+
self._ensure_connected()
|
|
183
231
|
return self._run(self._async_client.check_win(order_id))
|
|
184
232
|
|
|
185
233
|
def balance(self) -> float:
|
|
186
234
|
"""Get current balance."""
|
|
235
|
+
self._ensure_connected()
|
|
187
236
|
return self._run(self._async_client.balance())
|
|
188
237
|
|
|
189
238
|
def candles(self, asset: str, period: int) -> List[dict]:
|
|
190
239
|
"""Get historical candles."""
|
|
240
|
+
self._ensure_connected()
|
|
191
241
|
return self._run(self._async_client.candles(asset, period))
|
|
192
242
|
|
|
193
243
|
def get_candles(self, asset: str, period: int, count: int = 100) -> List[dict]:
|
|
194
244
|
"""Get historical candles with count."""
|
|
245
|
+
self._ensure_connected()
|
|
195
246
|
return self._run(self._async_client.get_candles(asset, period, count))
|
|
196
247
|
|
|
248
|
+
def get_ticks(self, asset: str) -> List[dict]:
|
|
249
|
+
"""Get tick series for an asset."""
|
|
250
|
+
self._ensure_connected()
|
|
251
|
+
return self._run(self._async_client.get_ticks(asset))
|
|
252
|
+
|
|
197
253
|
def get_candles_live(self, asset: str, period: int) -> SyncCandleLiveIterator:
|
|
198
254
|
"""Get live candle updates."""
|
|
255
|
+
self._ensure_connected()
|
|
199
256
|
async_gen = self._run(self._async_client.get_candles_live(asset, period))
|
|
200
257
|
return SyncCandleLiveIterator(async_gen, self._loop)
|
|
201
258
|
|
|
202
259
|
def subscribe_symbol(self, symbol: str) -> SyncSubscription:
|
|
203
260
|
"""Subscribe to price updates for a symbol."""
|
|
261
|
+
self._ensure_connected()
|
|
204
262
|
sub = self._run(self._async_client.subscribe_symbol(symbol))
|
|
205
263
|
return SyncSubscription(sub, self._loop)
|
|
206
264
|
|
|
207
265
|
def subscribe_raw(self) -> SyncRawSubscription:
|
|
208
266
|
"""Subscribe to all raw messages."""
|
|
267
|
+
self._ensure_connected()
|
|
209
268
|
sub = self._run(self._async_client.subscribe_raw())
|
|
210
269
|
return SyncRawSubscription(sub, self._loop)
|
|
211
270
|
|
|
212
271
|
def send_raw(self, message: str) -> None:
|
|
213
272
|
"""Send a raw message."""
|
|
273
|
+
self._ensure_connected()
|
|
214
274
|
self._run(self._async_client.send_raw(message))
|
|
215
275
|
|
|
216
276
|
def active_assets(self) -> List[dict]:
|
|
217
277
|
"""Get list of active assets."""
|
|
278
|
+
self._ensure_connected()
|
|
218
279
|
return self._run(self._async_client.active_assets())
|
|
219
280
|
|
|
220
281
|
def payout(self, asset: str) -> float:
|
|
221
282
|
"""Get payout for an asset."""
|
|
283
|
+
self._ensure_connected()
|
|
222
284
|
return self._run(self._async_client.payout(asset))
|
|
223
285
|
|
|
224
286
|
def history(self, limit: int = 100) -> List[dict]:
|
|
225
287
|
"""Get trade history."""
|
|
288
|
+
self._ensure_connected()
|
|
226
289
|
return self._run(self._async_client.history(limit))
|
|
227
290
|
|
|
228
291
|
def opened_deals(self) -> List[dict]:
|
|
229
292
|
"""Get opened deals."""
|
|
293
|
+
self._ensure_connected()
|
|
230
294
|
return self._run(self._async_client.opened_deals())
|
|
231
295
|
|
|
232
296
|
def closed_deals(self) -> List[dict]:
|
|
233
297
|
"""Get closed deals."""
|
|
298
|
+
self._ensure_connected()
|
|
234
299
|
return self._run(self._async_client.closed_deals())
|
|
235
300
|
|
|
236
301
|
def get_server_time(self) -> int:
|
|
237
302
|
"""Get server time."""
|
|
303
|
+
self._ensure_connected()
|
|
238
304
|
return self._run(self._async_client.get_server_time())
|
|
239
305
|
|
|
240
306
|
def raw_handler(self) -> RawHandlerSync:
|
|
241
307
|
"""Get raw handler for advanced operations."""
|
|
308
|
+
self._ensure_connected()
|
|
242
309
|
handler = self._run(self._async_client.raw_handler())
|
|
243
310
|
return RawHandlerSync(handler)
|
|
244
311
|
|
|
@@ -248,10 +315,16 @@ class CloseOption:
|
|
|
248
315
|
return
|
|
249
316
|
self._closed = True
|
|
250
317
|
if self._async_client:
|
|
251
|
-
|
|
318
|
+
try:
|
|
319
|
+
self._run(self._async_client.shutdown())
|
|
320
|
+
except Exception:
|
|
321
|
+
pass
|
|
252
322
|
self._async_client = None
|
|
253
323
|
if self._loop and self._loop.is_running():
|
|
254
324
|
self._loop.call_soon_threadsafe(self._loop.stop)
|
|
325
|
+
if self._thread and self._thread.is_alive():
|
|
326
|
+
self._thread.join(timeout=5.0)
|
|
327
|
+
|
|
255
328
|
def reconnect(self) -> None:
|
|
256
329
|
"""Reconnect to the server."""
|
|
257
|
-
return self._run(self._async_client.reconnect())
|
|
330
|
+
return self._run(self._async_client.reconnect())
|
|
@@ -24,7 +24,7 @@ class Config:
|
|
|
24
24
|
max_allowed_loops: int = 100
|
|
25
25
|
sleep_interval: int = 100
|
|
26
26
|
reconnect_time: int = 5
|
|
27
|
-
connection_initialization_timeout_secs: int =
|
|
27
|
+
connection_initialization_timeout_secs: int = 120
|
|
28
28
|
timeout_secs: int = 30
|
|
29
29
|
urls: List[str] = field(default_factory=list)
|
|
30
30
|
proxy: str = None
|
|
@@ -597,7 +597,7 @@ class PocketOptionAsync:
|
|
|
597
597
|
def merge_candles(*groups: List[Dict]) -> List[Dict]:
|
|
598
598
|
res: Dict[int, Dict] = {}
|
|
599
599
|
for group in groups:
|
|
600
|
-
for candle in group:
|
|
600
|
+
for candle in group or []:
|
|
601
601
|
res[extract_time(candle)] = candle
|
|
602
602
|
return [res[ts] for ts in sorted(res)]
|
|
603
603
|
|
|
@@ -679,7 +679,7 @@ class PocketOptionAsync:
|
|
|
679
679
|
# 2. Fetch history while buffering ticks
|
|
680
680
|
offset_seconds = int(hours * 3600)
|
|
681
681
|
platform_time = int(time.time()) + platform_time_offset
|
|
682
|
-
|
|
682
|
+
|
|
683
683
|
try:
|
|
684
684
|
advanced_candles = await asyncio.wait_for(
|
|
685
685
|
self.get_candles_advanced(
|
|
@@ -688,16 +688,13 @@ class PocketOptionAsync:
|
|
|
688
688
|
offset_seconds,
|
|
689
689
|
platform_time,
|
|
690
690
|
),
|
|
691
|
-
timeout=3.0
|
|
691
|
+
timeout=3.0,
|
|
692
692
|
)
|
|
693
693
|
except Exception:
|
|
694
694
|
advanced_candles = []
|
|
695
695
|
|
|
696
696
|
try:
|
|
697
|
-
recent_candles = await asyncio.wait_for(
|
|
698
|
-
self.history(asset, period),
|
|
699
|
-
timeout=3.0
|
|
700
|
-
)
|
|
697
|
+
recent_candles = await asyncio.wait_for(self.history(asset, period), timeout=3.0)
|
|
701
698
|
except Exception:
|
|
702
699
|
recent_candles = []
|
|
703
700
|
|
|
@@ -708,7 +705,7 @@ class PocketOptionAsync:
|
|
|
708
705
|
period,
|
|
709
706
|
offset_seconds,
|
|
710
707
|
),
|
|
711
|
-
timeout=3.0
|
|
708
|
+
timeout=3.0,
|
|
712
709
|
)
|
|
713
710
|
except Exception:
|
|
714
711
|
compiled_candles = []
|
|
@@ -1188,6 +1185,7 @@ class PocketOptionAsync:
|
|
|
1188
1185
|
and may have different availability or latency characteristics. For advanced
|
|
1189
1186
|
historical data with specific time ranges, consider using `get_candles_advanced()`.
|
|
1190
1187
|
"""
|
|
1188
|
+
return json.loads(await self.client.history(asset, period))
|
|
1191
1189
|
|
|
1192
1190
|
async def get_ticks(self, asset: str, lookback_seconds: int) -> List[Tuple[int, float]]:
|
|
1193
1191
|
"""Retrieves historical tick data for an asset.
|
|
@@ -1223,7 +1221,7 @@ class PocketOptionAsync:
|
|
|
1223
1221
|
if not isinstance(lookback_seconds, int) or lookback_seconds <= 0:
|
|
1224
1222
|
raise ValueError("lookback_seconds must be a positive integer")
|
|
1225
1223
|
|
|
1226
|
-
return json.loads(await self.client.get_ticks(asset, lookback_seconds))
|
|
1224
|
+
return [tuple(tick) for tick in json.loads(await self.client.get_ticks(asset, lookback_seconds))]
|
|
1227
1225
|
|
|
1228
1226
|
async def compile_candles(self, asset: str, custom_period: int, lookback_period: int) -> List[Dict]:
|
|
1229
1227
|
"""Compiles custom candlesticks from raw tick history.
|
|
@@ -25,7 +25,6 @@ class SyncSubscription:
|
|
|
25
25
|
return json.loads(next(self.subscription))
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
|
|
29
28
|
class SyncCandleLiveIterator:
|
|
30
29
|
"""Synchronous iterator for live candle updates."""
|
|
31
30
|
|
|
@@ -47,6 +46,8 @@ class SyncCandleLiveIterator:
|
|
|
47
46
|
return asyncio.run_coroutine_threadsafe(get_next(), self.loop).result()
|
|
48
47
|
except StopIteration:
|
|
49
48
|
raise StopIteration
|
|
49
|
+
|
|
50
|
+
|
|
50
51
|
class RawHandlerSync:
|
|
51
52
|
"""Synchronous handler for advanced raw WebSocket message operations."""
|
|
52
53
|
|
|
@@ -390,6 +391,7 @@ class PocketOption:
|
|
|
390
391
|
Returns:
|
|
391
392
|
An iterator yielding (closed_candles, forming_candle).
|
|
392
393
|
"""
|
|
394
|
+
|
|
393
395
|
async def create_gen():
|
|
394
396
|
return self._client.get_candles_live(
|
|
395
397
|
asset=asset,
|
|
@@ -529,6 +531,7 @@ class PocketOption:
|
|
|
529
531
|
Returns:
|
|
530
532
|
A list of historical trade dictionaries.
|
|
531
533
|
"""
|
|
534
|
+
return self._run(self._client.history(asset, period))
|
|
532
535
|
|
|
533
536
|
def get_ticks(self, asset: str, lookback_seconds: int) -> List[Tuple[int, float]]:
|
|
534
537
|
"""Get historical tick data for an asset.
|