binaryoptionstoolsv2 0.2.11__tar.gz → 0.2.13__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.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/__init__.py +31 -7
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/config.py +12 -5
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/pocketoption/__init__.py +6 -4
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +269 -33
- binaryoptionstoolsv2-0.2.13/BinaryOptionsToolsV2/pocketoption/synchronous.py +769 -0
- binaryoptionstoolsv2-0.2.13/BinaryOptionsToolsV2/pocketoption/tools/__init__.py +7 -0
- binaryoptionstoolsv2-0.2.13/BinaryOptionsToolsV2/pocketoption/tools/login.py +515 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/validator.py +2 -6
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/Cargo.lock +804 -752
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/Cargo.toml +8 -8
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/LICENSE +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/PKG-INFO +66 -53
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/README.md +56 -43
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/Cargo.toml +11 -9
- {binaryoptionstoolsv2-0.2.11/crates/macros → binaryoptionstoolsv2-0.2.13/crates/binary_options_tools}/LICENSE +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/Readme.md +1 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/config.rs +13 -6
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +13 -9
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/state.rs +2 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/types.rs +1 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/lib.rs +3 -4
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/candle.rs +84 -15
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/connect.rs +51 -6
- binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/error.rs +137 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +10 -9
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +89 -14
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +42 -11
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +3 -6
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +0 -4
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +109 -45
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +213 -146
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +13 -6
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +85 -77
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +33 -34
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs +1 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +135 -42
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/ssid.rs +22 -10
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/state.rs +108 -14
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/types.rs +10 -20
- binaryoptionstoolsv2-0.2.13/crates/binary_options_tools/src/pocketoption/utils.rs +750 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/Cargo.toml +12 -10
- {binaryoptionstoolsv2-0.2.11/crates/binary_options_tools → binaryoptionstoolsv2-0.2.13/crates/bindings_pyo3}/LICENSE +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/Readme.md +20 -34
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/build.rs +11 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/config.rs +55 -4
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/error.rs +82 -60
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/framework.rs +1 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/lib.rs +29 -3
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/pocketoption.rs +45 -14
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/Cargo.toml +5 -5
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/LICENSE +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/README.md +3 -3
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/docs/testing-framework.md +3 -3
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/macros/Cargo.toml +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/macros/LICENSE +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/macros/src/modules/lightweight.rs +0 -3
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/macros/src/rule.rs +3 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/client.rs +45 -19
- binaryoptionstoolsv2-0.2.13/crates/core/src/message.rs +5 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/middleware.rs +1 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/rules.rs +15 -5
- binaryoptionstoolsv2-0.2.13/crates/core/src/signals.rs +60 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/tests/rule_macro_tests.rs +70 -72
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/tests/runner_command_tests.rs +8 -20
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/tests/stream_tests.rs +17 -14
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/tests/testing_wrapper_tests.rs +1 -1
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/tests/two_step_standalone.rs +20 -25
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/Cargo.toml +8 -11
- {binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3 → binaryoptionstoolsv2-0.2.13/crates/macros}/LICENSE +2 -2
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/src/lib.rs +1 -42
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/pyproject.toml +10 -11
- binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/pocketoption/synchronous.py +0 -287
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/error.rs +0 -73
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/utils.rs +0 -445
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/reimports.rs +0 -1
- binaryoptionstoolsv2-0.2.11/crates/core/examples/basic_connector_usage.rs +0 -72
- binaryoptionstoolsv2-0.2.11/crates/core/src/message.rs +0 -1
- binaryoptionstoolsv2-0.2.11/crates/core/src/signals.rs +0 -45
- binaryoptionstoolsv2-0.2.11/crates/macros/examples/action_example.rs +0 -49
- binaryoptionstoolsv2-0.2.11/crates/macros/readme.md +0 -1
- binaryoptionstoolsv2-0.2.11/crates/macros/src/config.rs +0 -366
- binaryoptionstoolsv2-0.2.11/crates/macros/src/deserialize.rs +0 -26
- binaryoptionstoolsv2-0.2.11/crates/macros/src/impls/mod.rs +0 -1
- binaryoptionstoolsv2-0.2.11/crates/macros/src/impls/module_impl.rs +0 -31
- binaryoptionstoolsv2-0.2.11/crates/macros/src/serialize.rs +0 -21
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/tracing.py +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/client.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/connect.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/framework/market.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/framework/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/framework/virtual_market.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/deals_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/resilient_parsing_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/concurrency.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/binary_options_tools/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/logs.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/runtime.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/bindings_pyo3/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/diagrams/architecture.txt +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/diagrams/diagram.txt +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/examples/echo_client.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/examples/middleware_example.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/examples/testing_echo_client.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/macros/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/macros/src/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/builder.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/callback.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/connector.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/error.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/lib.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/reimports.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/statistics.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/testing.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/utils/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/utils/time.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/src/utils/tracing.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/core/tests/middleware_tests.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/ActionImpl_README.md +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/Cargo.lock +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/src/action.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/src/region.rs +0 -0
- {binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/crates/macros/src/timeout.rs +0 -0
{binaryoptionstoolsv2-0.2.11 → binaryoptionstoolsv2-0.2.13}/BinaryOptionsToolsV2/__init__.py
RENAMED
|
@@ -4,7 +4,13 @@ import sys
|
|
|
4
4
|
from .config import Config as Config
|
|
5
5
|
from . import tracing as tracing
|
|
6
6
|
from . import validator as validator
|
|
7
|
-
from .pocketoption import
|
|
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
|
+
)
|
|
8
14
|
|
|
9
15
|
# Import the Rust module and re-export its attributes
|
|
10
16
|
_rust_module = None
|
|
@@ -25,12 +31,30 @@ elif os.environ.get("PYTEST_CURRENT_TEST"):
|
|
|
25
31
|
|
|
26
32
|
# Names expected from the Rust cdylib; only those actually loaded will be available
|
|
27
33
|
_rust_exported_names = [
|
|
28
|
-
"RawPocketOption",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
34
|
+
"RawPocketOption",
|
|
35
|
+
"RawValidator",
|
|
36
|
+
"RawHandler",
|
|
37
|
+
"RawHandle",
|
|
38
|
+
"Logger",
|
|
39
|
+
"LogBuilder",
|
|
40
|
+
"PyConfig",
|
|
41
|
+
"PyBot",
|
|
42
|
+
"PyStrategy",
|
|
43
|
+
"PyContext",
|
|
44
|
+
"PyVirtualMarket",
|
|
45
|
+
"Action",
|
|
46
|
+
"StreamLogsIterator",
|
|
47
|
+
"StreamLogsLayer",
|
|
48
|
+
"StreamIterator",
|
|
49
|
+
"RawStreamIterator",
|
|
50
|
+
"start_tracing",
|
|
33
51
|
]
|
|
34
52
|
__rust_all__ = [n for n in _rust_exported_names if n in globals()]
|
|
35
53
|
|
|
36
|
-
__all__ = list(
|
|
54
|
+
__all__ = list(
|
|
55
|
+
set(
|
|
56
|
+
__pocket_all__
|
|
57
|
+
+ ["tracing", "validator", "PocketOptionAsync", "PocketOption", "RawHandler", "Validator"]
|
|
58
|
+
+ __rust_all__
|
|
59
|
+
)
|
|
60
|
+
)
|
|
@@ -27,7 +27,12 @@ class Config:
|
|
|
27
27
|
connection_initialization_timeout_secs: int = 60
|
|
28
28
|
timeout_secs: int = 30
|
|
29
29
|
urls: List[str] = field(default_factory=list)
|
|
30
|
-
|
|
30
|
+
proxy: str = None
|
|
31
|
+
user_agent: str = None
|
|
32
|
+
origin: str = None
|
|
33
|
+
sec_websocket_extensions: str = None
|
|
34
|
+
tls_cipher_suites: List[str] = None
|
|
35
|
+
tls_alpn: List[str] = None
|
|
31
36
|
|
|
32
37
|
# Logging configuration
|
|
33
38
|
terminal_logging: bool = False
|
|
@@ -67,7 +72,12 @@ class Config:
|
|
|
67
72
|
self._pyconfig.connection_initialization_timeout_secs = self.connection_initialization_timeout_secs
|
|
68
73
|
self._pyconfig.timeout_secs = self.timeout_secs
|
|
69
74
|
self._pyconfig.urls = self.urls
|
|
70
|
-
self._pyconfig.
|
|
75
|
+
self._pyconfig.proxy = self.proxy
|
|
76
|
+
self._pyconfig.user_agent = self.user_agent
|
|
77
|
+
self._pyconfig.origin = self.origin
|
|
78
|
+
self._pyconfig.sec_websocket_extensions = self.sec_websocket_extensions
|
|
79
|
+
self._pyconfig.tls_cipher_suites = self.tls_cipher_suites
|
|
80
|
+
self._pyconfig.tls_alpn = self.tls_alpn
|
|
71
81
|
|
|
72
82
|
def _validate(self):
|
|
73
83
|
"""Validate config values, raising ValueError on invalid input."""
|
|
@@ -81,8 +91,6 @@ class Config:
|
|
|
81
91
|
raise ValueError("connection_initialization_timeout_secs must be at least 1")
|
|
82
92
|
if self.timeout_secs < 1:
|
|
83
93
|
raise ValueError("timeout_secs must be at least 1")
|
|
84
|
-
if self.max_subscriptions < 1:
|
|
85
|
-
raise ValueError("max_subscriptions must be at least 1")
|
|
86
94
|
|
|
87
95
|
@classmethod
|
|
88
96
|
def from_dict(cls, config_dict: Dict[str, Any]) -> "Config":
|
|
@@ -105,7 +113,6 @@ class Config:
|
|
|
105
113
|
"connection_initialization_timeout_secs": self.connection_initialization_timeout_secs,
|
|
106
114
|
"timeout_secs": self.timeout_secs,
|
|
107
115
|
"urls": self.urls,
|
|
108
|
-
"max_subscriptions": self.max_subscriptions,
|
|
109
116
|
"terminal_logging": self.terminal_logging,
|
|
110
117
|
"log_level": self.log_level,
|
|
111
118
|
"extra_duration": self.extra_duration,
|
|
@@ -7,13 +7,15 @@ as well as specific classes for Pocket Option trading.
|
|
|
7
7
|
|
|
8
8
|
__all__ = [
|
|
9
9
|
"asynchronous",
|
|
10
|
-
"
|
|
10
|
+
"login",
|
|
11
|
+
"login_async",
|
|
11
12
|
"PocketOptionAsync",
|
|
12
13
|
"PocketOption",
|
|
13
14
|
"RawHandler",
|
|
14
15
|
"RawHandlerSync",
|
|
16
|
+
"Validator",
|
|
15
17
|
]
|
|
16
|
-
|
|
17
|
-
from . import asynchronous, synchronous
|
|
18
|
-
from .asynchronous import PocketOptionAsync, RawHandler
|
|
18
|
+
from .tools.login import login, login_async
|
|
19
|
+
from . import asynchronous, synchronous as synchronous
|
|
20
|
+
from .asynchronous import PocketOptionAsync, RawHandler, Validator
|
|
19
21
|
from .synchronous import PocketOption, RawHandlerSync
|
|
@@ -2,8 +2,11 @@ import asyncio
|
|
|
2
2
|
import json
|
|
3
3
|
import re
|
|
4
4
|
import sys
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import time
|
|
6
|
+
import warnings
|
|
7
|
+
from collections import deque
|
|
8
|
+
from datetime import datetime, timezone, timedelta
|
|
9
|
+
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union, AsyncGenerator
|
|
7
10
|
|
|
8
11
|
from ..config import Config
|
|
9
12
|
from ..validator import Validator
|
|
@@ -30,6 +33,18 @@ class AsyncSubscription:
|
|
|
30
33
|
return json.loads(await anext(self.subscription))
|
|
31
34
|
|
|
32
35
|
|
|
36
|
+
class AsyncRawSubscription:
|
|
37
|
+
def __init__(self, subscription):
|
|
38
|
+
"""Asynchronous Iterator over raw message strings"""
|
|
39
|
+
self.subscription = subscription
|
|
40
|
+
|
|
41
|
+
def __aiter__(self):
|
|
42
|
+
return self
|
|
43
|
+
|
|
44
|
+
async def __anext__(self):
|
|
45
|
+
return await anext(self.subscription)
|
|
46
|
+
|
|
47
|
+
|
|
33
48
|
class RawHandler:
|
|
34
49
|
"""
|
|
35
50
|
Handler for advanced raw WebSocket message operations.
|
|
@@ -191,7 +206,7 @@ def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
|
|
|
191
206
|
warnings_list.append(f"missing required field '{field}'")
|
|
192
207
|
|
|
193
208
|
session = auth_data.get("session", "")
|
|
194
|
-
if session and not re.match(r
|
|
209
|
+
if session and not re.match(r"^[a-zA-Z0-9_\-]{10,}$", str(session)):
|
|
195
210
|
warnings_list.append(f"session token has unexpected format (length={len(str(session))})")
|
|
196
211
|
|
|
197
212
|
uid = auth_data.get("uid")
|
|
@@ -219,7 +234,8 @@ def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
|
|
|
219
234
|
raise ValueError(
|
|
220
235
|
"Invalid SSID: " + "; ".join(critical) + ". "
|
|
221
236
|
"The SSID payload must contain 'session' and 'uid' fields. "
|
|
222
|
-
"Ensure your SSID follows the format: 42['auth',{{'session':'...','uid':123,...}}]"
|
|
237
|
+
"Ensure your SSID follows the format: 42['auth',{{'session':'...','uid':123,...}}]"
|
|
238
|
+
)
|
|
223
239
|
|
|
224
240
|
return ssid
|
|
225
241
|
|
|
@@ -452,9 +468,23 @@ class PocketOptionAsync:
|
|
|
452
468
|
- high: Highest price
|
|
453
469
|
- low: Lowest price
|
|
454
470
|
- close: Closing price
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
471
|
+
|
|
472
|
+
Note:
|
|
473
|
+
WARNING: This function only fetches closed historical candles and is intended
|
|
474
|
+
for training models, backtesting, or historical analysis. It is NOT designed
|
|
475
|
+
for real-time/live trading as it does not include the current forming candle
|
|
476
|
+
and can introduce gaps if called sequentially during live trading.
|
|
477
|
+
For live gap-free candle feeds, use `get_candles_live()` instead.
|
|
478
|
+
"""
|
|
479
|
+
warnings.warn(
|
|
480
|
+
"candles() is deprecated and will be removed in a new release. "
|
|
481
|
+
"Please use get_candles_live() for live gap-free candles instead.",
|
|
482
|
+
DeprecationWarning,
|
|
483
|
+
stacklevel=2,
|
|
484
|
+
)
|
|
485
|
+
gen = self.get_candles_live(asset, period, hours=2.0)
|
|
486
|
+
closed, forming = await anext(gen)
|
|
487
|
+
return closed
|
|
458
488
|
|
|
459
489
|
async def get_candles(self, asset: str, period: int, offset: int) -> List[Dict]:
|
|
460
490
|
"""
|
|
@@ -462,8 +492,8 @@ class PocketOptionAsync:
|
|
|
462
492
|
|
|
463
493
|
Args:
|
|
464
494
|
asset (str): Trading asset (e.g., "EURUSD_otc")
|
|
465
|
-
timeframe (int): Candle timeframe in seconds (e.g., 60 for 1-minute candles)
|
|
466
495
|
period (int): Historical period in seconds to fetch
|
|
496
|
+
offset (int): Candle timeframe in seconds (e.g., 60 for 1-minute candles)
|
|
467
497
|
|
|
468
498
|
Returns:
|
|
469
499
|
List[Dict]: List of candles, each containing:
|
|
@@ -474,11 +504,24 @@ class PocketOptionAsync:
|
|
|
474
504
|
- close: Closing price
|
|
475
505
|
|
|
476
506
|
Note:
|
|
477
|
-
Available timeframes: 1, 5, 15, 30, 60, 300 seconds
|
|
478
|
-
Maximum period depends on the timeframe
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
507
|
+
- Available timeframes: 1, 5, 15, 30, 60, 300 seconds
|
|
508
|
+
- Maximum period depends on the timeframe
|
|
509
|
+
- WARNING: This function only fetches closed historical candles and is intended
|
|
510
|
+
for training models, backtesting, or historical analysis. It is NOT designed
|
|
511
|
+
for real-time/live trading as it does not include the current forming candle
|
|
512
|
+
and can introduce gaps if called sequentially during live trading.
|
|
513
|
+
For live gap-free candle feeds, use `get_candles_live()` instead.
|
|
514
|
+
"""
|
|
515
|
+
warnings.warn(
|
|
516
|
+
"get_candles() is deprecated and will be removed in a new release. "
|
|
517
|
+
"Please use get_candles_live() for live gap-free candles instead.",
|
|
518
|
+
DeprecationWarning,
|
|
519
|
+
stacklevel=2,
|
|
520
|
+
)
|
|
521
|
+
hours = max(0.1, offset / 3600.0)
|
|
522
|
+
gen = self.get_candles_live(asset, period, hours=hours)
|
|
523
|
+
closed, forming = await anext(gen)
|
|
524
|
+
return closed
|
|
482
525
|
|
|
483
526
|
async def get_candles_advanced(self, asset: str, period: int, offset: int, time: int) -> List[Dict]:
|
|
484
527
|
"""
|
|
@@ -486,8 +529,8 @@ class PocketOptionAsync:
|
|
|
486
529
|
|
|
487
530
|
Args:
|
|
488
531
|
asset (str): Trading asset (e.g., "EURUSD_otc")
|
|
489
|
-
timeframe (int): Candle timeframe in seconds (e.g., 60 for 1-minute candles)
|
|
490
532
|
period (int): Historical period in seconds to fetch
|
|
533
|
+
offset (int): Candle timeframe in seconds (e.g., 60 for 1-minute candles)
|
|
491
534
|
time (int): Time to fetch candles from
|
|
492
535
|
|
|
493
536
|
Returns:
|
|
@@ -499,12 +542,209 @@ class PocketOptionAsync:
|
|
|
499
542
|
- close: Closing price
|
|
500
543
|
|
|
501
544
|
Note:
|
|
502
|
-
Available timeframes: 1, 5, 15, 30, 60, 300 seconds
|
|
503
|
-
Maximum period depends on the timeframe
|
|
545
|
+
- Available timeframes: 1, 5, 15, 30, 60, 300 seconds
|
|
546
|
+
- Maximum period depends on the timeframe
|
|
547
|
+
- WARNING: This function only fetches closed historical candles and is intended
|
|
548
|
+
for training models, backtesting, or historical analysis. It is NOT designed
|
|
549
|
+
for real-time/live trading as it does not include the current forming candle
|
|
550
|
+
and can introduce gaps if called sequentially during live trading.
|
|
551
|
+
For live gap-free candle feeds, use `get_candles_live()` instead.
|
|
504
552
|
"""
|
|
505
553
|
candles = await self.client.get_candles_advanced(asset, period, offset, time)
|
|
506
554
|
return json.loads(candles)
|
|
507
555
|
|
|
556
|
+
async def get_candles_live(
|
|
557
|
+
self,
|
|
558
|
+
asset: str,
|
|
559
|
+
period: int,
|
|
560
|
+
hours: float = 2.0,
|
|
561
|
+
max_rows: int = 100,
|
|
562
|
+
) -> AsyncGenerator[Tuple[List[Dict], Optional[Dict]], None]:
|
|
563
|
+
"""Fetches historical backfill and streams gap-free live candles.
|
|
564
|
+
|
|
565
|
+
This method subscribes to raw ticks first and buffers them, then fetches
|
|
566
|
+
historical candles (using get_candles_advanced, history, and compile_candles),
|
|
567
|
+
merges them, replays the buffered ticks, and yields updated candles (both
|
|
568
|
+
closed historical candles and the current forming candle) in real-time.
|
|
569
|
+
|
|
570
|
+
Args:
|
|
571
|
+
asset (str): Trading asset (e.g., "EURUSD_otc")
|
|
572
|
+
period (int): Candle timeframe in seconds (e.g., 60 for 1-minute candles)
|
|
573
|
+
hours (float): Hours of history to backfill. Defaults to 2.0.
|
|
574
|
+
max_rows (int): Maximum number of closed candles to retain in history. Defaults to 100.
|
|
575
|
+
|
|
576
|
+
Yields:
|
|
577
|
+
Tuple[List[Dict], Optional[Dict]]: A tuple containing:
|
|
578
|
+
- List[Dict]: List of closed candles (up to max_rows), each containing
|
|
579
|
+
'time', 'open', 'high', 'low', 'close'.
|
|
580
|
+
- Optional[Dict]: The currently forming candle, containing 'time', 'open',
|
|
581
|
+
'high', 'low', 'close', or None if not yet started.
|
|
582
|
+
"""
|
|
583
|
+
platform_time_offset = 7200
|
|
584
|
+
|
|
585
|
+
def bucket_start(timestamp: int, p: int) -> int:
|
|
586
|
+
return (timestamp // p) * p
|
|
587
|
+
|
|
588
|
+
def extract_time(candle: Dict) -> int:
|
|
589
|
+
val = int(float(candle.get("timestamp", candle.get("time", 0))))
|
|
590
|
+
if val > 10_000_000_000:
|
|
591
|
+
val //= 1000
|
|
592
|
+
return val - platform_time_offset
|
|
593
|
+
|
|
594
|
+
def merge_candles(*groups: List[Dict]) -> List[Dict]:
|
|
595
|
+
res: Dict[int, Dict] = {}
|
|
596
|
+
for group in groups:
|
|
597
|
+
for candle in group:
|
|
598
|
+
res[extract_time(candle)] = candle
|
|
599
|
+
return [res[ts] for ts in sorted(res)]
|
|
600
|
+
|
|
601
|
+
# Initialize feed
|
|
602
|
+
feed_candles: deque = deque(maxlen=max_rows)
|
|
603
|
+
forming: Optional[Dict] = None
|
|
604
|
+
|
|
605
|
+
def seed_history(history: List[Dict]) -> None:
|
|
606
|
+
cutoff = bucket_start(int(time.time()), period)
|
|
607
|
+
ordered = sorted(
|
|
608
|
+
(c for c in history if extract_time(c) < cutoff),
|
|
609
|
+
key=extract_time,
|
|
610
|
+
)
|
|
611
|
+
for c in ordered[-max_rows:]:
|
|
612
|
+
feed_candles.append(
|
|
613
|
+
{
|
|
614
|
+
"time": extract_time(c),
|
|
615
|
+
"open": float(c["open"]),
|
|
616
|
+
"high": float(c["high"]),
|
|
617
|
+
"low": float(c["low"]),
|
|
618
|
+
"close": float(c["close"]),
|
|
619
|
+
}
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
def ingest_tick(timestamp: int, price: float) -> None:
|
|
623
|
+
nonlocal forming
|
|
624
|
+
if forming is None:
|
|
625
|
+
start = bucket_start(timestamp, period)
|
|
626
|
+
forming = {
|
|
627
|
+
"time": start,
|
|
628
|
+
"open": price,
|
|
629
|
+
"high": price,
|
|
630
|
+
"low": price,
|
|
631
|
+
"close": price,
|
|
632
|
+
}
|
|
633
|
+
return
|
|
634
|
+
|
|
635
|
+
start = bucket_start(timestamp, period)
|
|
636
|
+
if start == forming["time"]:
|
|
637
|
+
forming["high"] = max(forming["high"], price)
|
|
638
|
+
forming["low"] = min(forming["low"], price)
|
|
639
|
+
forming["close"] = price
|
|
640
|
+
elif start > forming["time"]:
|
|
641
|
+
feed_candles.append(dict(forming))
|
|
642
|
+
forming = {
|
|
643
|
+
"time": start,
|
|
644
|
+
"open": price,
|
|
645
|
+
"high": price,
|
|
646
|
+
"low": price,
|
|
647
|
+
"close": price,
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
# 1. Subscribe to ticks FIRST
|
|
651
|
+
tick_buffer: List[Tuple[int, float]] = []
|
|
652
|
+
buffering = True
|
|
653
|
+
stream = await self.subscribe_symbol(asset)
|
|
654
|
+
|
|
655
|
+
queue = asyncio.Queue()
|
|
656
|
+
|
|
657
|
+
async def tick_reader():
|
|
658
|
+
nonlocal buffering
|
|
659
|
+
try:
|
|
660
|
+
async for tick in stream:
|
|
661
|
+
ts = extract_time(tick)
|
|
662
|
+
price = float(tick.get("close", tick.get("price", 0.0)))
|
|
663
|
+
if buffering:
|
|
664
|
+
tick_buffer.append((ts, price))
|
|
665
|
+
else:
|
|
666
|
+
ingest_tick(ts, price)
|
|
667
|
+
await queue.put((list(feed_candles), dict(forming) if forming else None))
|
|
668
|
+
except asyncio.CancelledError:
|
|
669
|
+
pass
|
|
670
|
+
finally:
|
|
671
|
+
await queue.put(None)
|
|
672
|
+
|
|
673
|
+
reader_task = asyncio.create_task(tick_reader())
|
|
674
|
+
|
|
675
|
+
try:
|
|
676
|
+
# 2. Fetch history while buffering ticks
|
|
677
|
+
offset_seconds = int(hours * 3600)
|
|
678
|
+
platform_time = int(time.time()) + platform_time_offset
|
|
679
|
+
|
|
680
|
+
try:
|
|
681
|
+
advanced_candles = await asyncio.wait_for(
|
|
682
|
+
self.get_candles_advanced(
|
|
683
|
+
asset,
|
|
684
|
+
period,
|
|
685
|
+
offset_seconds,
|
|
686
|
+
platform_time,
|
|
687
|
+
),
|
|
688
|
+
timeout=3.0
|
|
689
|
+
)
|
|
690
|
+
except Exception:
|
|
691
|
+
advanced_candles = []
|
|
692
|
+
|
|
693
|
+
try:
|
|
694
|
+
recent_candles = await asyncio.wait_for(
|
|
695
|
+
self.history(asset, period),
|
|
696
|
+
timeout=3.0
|
|
697
|
+
)
|
|
698
|
+
except Exception:
|
|
699
|
+
recent_candles = []
|
|
700
|
+
|
|
701
|
+
try:
|
|
702
|
+
compiled_candles = await asyncio.wait_for(
|
|
703
|
+
self.compile_candles(
|
|
704
|
+
asset,
|
|
705
|
+
period,
|
|
706
|
+
offset_seconds,
|
|
707
|
+
),
|
|
708
|
+
timeout=3.0
|
|
709
|
+
)
|
|
710
|
+
except Exception:
|
|
711
|
+
compiled_candles = []
|
|
712
|
+
|
|
713
|
+
history = merge_candles(
|
|
714
|
+
compiled_candles,
|
|
715
|
+
recent_candles,
|
|
716
|
+
advanced_candles,
|
|
717
|
+
)
|
|
718
|
+
seed_history(history)
|
|
719
|
+
|
|
720
|
+
# 3. Replay backlog
|
|
721
|
+
cutoff = 0
|
|
722
|
+
if feed_candles:
|
|
723
|
+
cutoff = feed_candles[-1]["time"] + period
|
|
724
|
+
for ts, price in sorted(tick_buffer):
|
|
725
|
+
if ts < cutoff:
|
|
726
|
+
continue
|
|
727
|
+
ingest_tick(ts, price)
|
|
728
|
+
|
|
729
|
+
buffering = False
|
|
730
|
+
# Yield initial seed state
|
|
731
|
+
yield list(feed_candles), dict(forming) if forming else None
|
|
732
|
+
|
|
733
|
+
# 4. Stream loop
|
|
734
|
+
while True:
|
|
735
|
+
item = await queue.get()
|
|
736
|
+
if item is None:
|
|
737
|
+
break
|
|
738
|
+
yield item
|
|
739
|
+
|
|
740
|
+
finally:
|
|
741
|
+
reader_task.cancel()
|
|
742
|
+
try:
|
|
743
|
+
await reader_task
|
|
744
|
+
except asyncio.CancelledError:
|
|
745
|
+
pass
|
|
746
|
+
await self.unsubscribe(asset)
|
|
747
|
+
|
|
508
748
|
async def balance(self) -> float:
|
|
509
749
|
"""
|
|
510
750
|
Retrieves current account balance.
|
|
@@ -589,7 +829,7 @@ class PocketOptionAsync:
|
|
|
589
829
|
if deal_json is None:
|
|
590
830
|
return None
|
|
591
831
|
return json.loads(deal_json)
|
|
592
|
-
|
|
832
|
+
|
|
593
833
|
async def open_pending_order(
|
|
594
834
|
self,
|
|
595
835
|
open_type: int,
|
|
@@ -608,7 +848,7 @@ class PocketOptionAsync:
|
|
|
608
848
|
open_type (int): The type of the pending order.
|
|
609
849
|
amount (float): The amount to trade.
|
|
610
850
|
asset (str): The asset symbol (e.g., "EURUSD_otc").
|
|
611
|
-
open_time (int | str): The server time to open the trade.
|
|
851
|
+
open_time (int | str): The server time to open the trade.
|
|
612
852
|
Can be a Unix timestamp (int) or a formatted string "YYYY-MM-DD HH:MM:SS".
|
|
613
853
|
open_price (float): The price to open the trade at.
|
|
614
854
|
timeframe (int): The duration of the trade in seconds.
|
|
@@ -641,13 +881,14 @@ class PocketOptionAsync:
|
|
|
641
881
|
# We can't easily convert "YYYY-MM-DD" to timestamp without more info,
|
|
642
882
|
# but for the sake of not crashing, we'll try to parse it or use 0.
|
|
643
883
|
from datetime import datetime
|
|
884
|
+
|
|
644
885
|
try:
|
|
645
886
|
# PocketOption strings are usually UTC
|
|
646
|
-
dt = datetime.strptime(open_time,
|
|
887
|
+
dt = datetime.strptime(open_time, "%Y-%m-%d %H:%M:%S")
|
|
647
888
|
actual_open_time = int(dt.timestamp())
|
|
648
889
|
except Exception:
|
|
649
890
|
actual_open_time = 0
|
|
650
|
-
|
|
891
|
+
|
|
651
892
|
# Retry with converted integer
|
|
652
893
|
order = await self.client.open_pending_order(
|
|
653
894
|
open_type, amount, asset, actual_open_time, open_price, timeframe, min_payout, command
|
|
@@ -789,7 +1030,6 @@ class PocketOptionAsync:
|
|
|
789
1030
|
return None
|
|
790
1031
|
return json.loads(deal_json)
|
|
791
1032
|
|
|
792
|
-
|
|
793
1033
|
async def clear_closed_deals(self) -> None:
|
|
794
1034
|
"""Removes all closed deals from the client's memory.
|
|
795
1035
|
|
|
@@ -986,6 +1226,14 @@ class PocketOptionAsync:
|
|
|
986
1226
|
|
|
987
1227
|
return json.loads(await self.client.compile_candles(asset, custom_period, lookback_period))
|
|
988
1228
|
|
|
1229
|
+
async def send_raw(self, message: str) -> None:
|
|
1230
|
+
"""Send a raw Engine.io/Socket.io message directly over the connection."""
|
|
1231
|
+
await self.client.send_raw(message)
|
|
1232
|
+
|
|
1233
|
+
async def subscribe_raw(self) -> AsyncRawSubscription:
|
|
1234
|
+
"""Subscribe to all incoming WebSocket messages verbatim."""
|
|
1235
|
+
return AsyncRawSubscription(await self.client.subscribe_raw())
|
|
1236
|
+
|
|
989
1237
|
async def subscribe_symbol(self, asset: str) -> AsyncSubscription:
|
|
990
1238
|
"""Subscribe to real-time raw price updates for an asset.
|
|
991
1239
|
|
|
@@ -1127,15 +1375,6 @@ class PocketOptionAsync:
|
|
|
1127
1375
|
"""Returns whether the SSID passed basic format validation during init."""
|
|
1128
1376
|
return self._ssid_valid
|
|
1129
1377
|
|
|
1130
|
-
def max_subscriptions(self) -> int:
|
|
1131
|
-
"""
|
|
1132
|
-
Returns the configured maximum number of concurrent subscriptions.
|
|
1133
|
-
|
|
1134
|
-
Returns:
|
|
1135
|
-
int: Maximum number of concurrent asset subscriptions allowed
|
|
1136
|
-
"""
|
|
1137
|
-
return self.client.max_subscriptions()
|
|
1138
|
-
|
|
1139
1378
|
async def disconnect(self) -> None:
|
|
1140
1379
|
"""
|
|
1141
1380
|
Disconnects the client while keeping the configuration intact.
|
|
@@ -1520,6 +1759,3 @@ class PocketOptionAsync:
|
|
|
1520
1759
|
async context manager or when it is garbage collected.
|
|
1521
1760
|
"""
|
|
1522
1761
|
return await self.client.create_raw_iterator(message, validator.raw_validator, timeout)
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|