binaryoptionstoolsv2 0.2.8__tar.gz → 0.2.11__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.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +19 -2
- binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/__init__.py +36 -0
- {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/config.py +124 -143
- {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +405 -282
- binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/pocketoption/synchronous.py +287 -0
- binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/tracing.py +91 -0
- binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/validator.py +80 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11}/Cargo.lock +831 -338
- binaryoptionstoolsv2-0.2.11/Cargo.toml +41 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11}/LICENSE +100 -100
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/PKG-INFO +1 -1
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/Cargo.toml +46 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/config.rs +6 -0
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/error.rs +37 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/action.rs +1 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/client.rs +1 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/connect.rs +3 -3
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/error.rs +1 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +5 -16
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +5 -5
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/state.rs +1 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/types.rs +2 -2
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/virtual_market.rs +5 -5
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/lib.rs +3 -3
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/candle.rs +285 -15
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/connect.rs +3 -3
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/error.rs +7 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +265 -263
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +101 -84
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +114 -61
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/deals_tests.rs +147 -0
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +704 -0
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +500 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +13 -3
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +6 -0
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +523 -0
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +1091 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +104 -53
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/resilient_parsing_tests.rs +117 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +84 -66
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +261 -209
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +86 -28
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs +3 -3
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/concurrency.rs +40 -16
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +159 -106
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/ssid.rs +251 -27
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/state.rs +431 -405
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/types.rs +57 -24
- binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/utils.rs +445 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/utils/mod.rs +1 -1
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/Cargo.toml +19 -18
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/build.rs +6 -2
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/config.rs +10 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/error.rs +15 -2
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/framework.rs +120 -141
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/lib.rs +12 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/logs.rs +4 -4
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/pocketoption.rs +127 -42
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/validator.rs +2 -49
- binaryoptionstoolsv2-0.2.11/crates/core/Cargo.toml +35 -0
- binaryoptionstoolsv2-0.2.11/crates/core/LICENSE +100 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/README.md +2 -2
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/diagrams/architecture.txt +51 -51
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/diagrams/diagram.txt +40 -40
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/docs/testing-framework.md +10 -10
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/basic_connector_usage.rs +72 -72
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/echo_client.rs +6 -6
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/middleware_example.rs +6 -6
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/testing_echo_client.rs +7 -7
- binaryoptionstoolsv2-0.2.11/crates/core/macros/Cargo.toml +14 -0
- binaryoptionstoolsv2-0.2.11/crates/core/macros/LICENSE +100 -0
- binaryoptionstoolsv2-0.2.11/crates/core/macros/src/lib.rs +184 -0
- binaryoptionstoolsv2-0.2.11/crates/core/macros/src/modules/lightweight.rs +7 -0
- binaryoptionstoolsv2-0.2.11/crates/core/macros/src/modules/mod.rs +1 -0
- binaryoptionstoolsv2-0.2.11/crates/core/macros/src/rule.rs +570 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/builder.rs +28 -27
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/callback.rs +51 -51
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/client.rs +140 -155
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/connector.rs +52 -52
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/error.rs +51 -49
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/lib.rs +3 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/message.rs +1 -1
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/middleware.rs +502 -502
- binaryoptionstoolsv2-0.2.11/crates/core/src/rules.rs +783 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/statistics.rs +8 -18
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/testing.rs +623 -623
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/traits.rs +250 -233
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/stream.rs +8 -4
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/time.rs +20 -20
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/tests/middleware_tests.rs +3 -3
- binaryoptionstoolsv2-0.2.11/crates/core/tests/rule_macro_tests.rs +860 -0
- binaryoptionstoolsv2-0.2.11/crates/core/tests/runner_command_tests.rs +169 -0
- binaryoptionstoolsv2-0.2.11/crates/core/tests/stream_tests.rs +67 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/tests/testing_wrapper_tests.rs +196 -198
- binaryoptionstoolsv2-0.2.11/crates/core/tests/two_step_standalone.rs +185 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/Cargo.toml +11 -11
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/action.rs +3 -3
- binaryoptionstoolsv2-0.2.11/crates/macros/src/impls/mod.rs +1 -0
- binaryoptionstoolsv2-0.2.11/crates/macros/src/impls/module_impl.rs +31 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/lib.rs +21 -3
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/region.rs +10 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/timeout.rs +1 -1
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/pyproject.toml +3 -3
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/Cargo.lock +0 -2498
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/Cargo.toml +0 -47
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/error.rs +0 -79
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +0 -348
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +0 -1041
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +0 -328
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +0 -805
- binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/utils.rs +0 -223
- binaryoptionstoolsv2-0.2.8/crates/core-pre/.vscode/mcp.json +0 -13
- binaryoptionstoolsv2-0.2.8/crates/core-pre/Cargo.toml +0 -26
- binaryoptionstoolsv2-0.2.8/crates/macros/LICENSE +0 -100
- binaryoptionstoolsv2-0.2.8/crates/macros/src/impls/config_impl.rs +0 -7
- binaryoptionstoolsv2-0.2.8/crates/macros/src/impls/mod.rs +0 -1
- binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/__init__.py +0 -54
- binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/pocketoption/synchronous.py +0 -724
- binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/tracing.py +0 -159
- binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/validator.py +0 -271
- {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -0
- /binaryoptionstoolsv2-0.2.8/Readme.md → /binaryoptionstoolsv2-0.2.11/README.md +0 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/binary_options_tools}/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/Readme.md +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/market.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/reimports.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/traits.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/validator.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/Readme.md +0 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/runtime.rs +0 -0
- {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/stream.rs +0 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/reimports.rs +0 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/signals.rs +0 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/mod.rs +0 -0
- {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/tracing.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/.gitignore +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/ActionImpl_README.md +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/Cargo.lock +0 -0
- {binaryoptionstoolsv2-0.2.8/crates/binary_options_tools → binaryoptionstoolsv2-0.2.11/crates/macros}/LICENSE +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/examples/action_example.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/readme.md +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/config.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/deserialize.rs +0 -0
- {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/serialize.rs +0 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
from typing import Any, Callable, List, Optional
|
|
1
|
+
from typing import Any, Callable, List, Optional, Tuple
|
|
2
|
+
|
|
3
|
+
class Action:
|
|
4
|
+
Call: "Action"
|
|
5
|
+
Put: "Action"
|
|
2
6
|
|
|
3
7
|
class PyConfig:
|
|
4
8
|
def __init__(
|
|
@@ -90,13 +94,15 @@ class RawPocketOption:
|
|
|
90
94
|
command: int,
|
|
91
95
|
) -> str: ...
|
|
92
96
|
async def closed_deals(self) -> str: ...
|
|
97
|
+
async def get_closed_deal(self, id: str) -> Optional[str]: ...
|
|
93
98
|
async def clear_closed_deals(self) -> None: ...
|
|
94
99
|
async def opened_deals(self) -> str: ...
|
|
100
|
+
async def get_opened_deal(self, id: str) -> Optional[str]: ...
|
|
95
101
|
async def payout(self) -> str: ...
|
|
96
102
|
async def history(self, asset: str, period: int) -> str: ...
|
|
97
103
|
async def compile_candles(self, asset: str, custom_period: int, lookback_period: int) -> str: ...
|
|
98
104
|
async def subscribe_symbol(self, symbol: str) -> StreamIterator: ...
|
|
99
|
-
async def
|
|
105
|
+
async def subscribe_symbol_chunked(self, symbol: str, chunk_size: int) -> StreamIterator: ...
|
|
100
106
|
async def subscribe_symbol_timed(self, symbol: str, time: Any) -> StreamIterator: ...
|
|
101
107
|
async def subscribe_symbol_time_aligned(self, symbol: str, time: Any) -> StreamIterator: ...
|
|
102
108
|
async def send_raw_message(self, message: str) -> None: ...
|
|
@@ -141,14 +147,25 @@ class PyVirtualMarket:
|
|
|
141
147
|
async def update_price(self, asset: str, price: float) -> None: ...
|
|
142
148
|
|
|
143
149
|
class PyStrategy:
|
|
150
|
+
current_candle: int
|
|
144
151
|
def __init__(self) -> None: ...
|
|
145
152
|
def on_start(self, ctx: PyContext) -> None: ...
|
|
146
153
|
def on_candle(self, ctx: PyContext, asset: str, candle_json: str) -> None: ...
|
|
154
|
+
def on_balance(self, ctx: PyContext, balance: float) -> None: ...
|
|
155
|
+
def trade(self, ctx: PyContext, asset: str, amount: float, timeframe: int, direction: Action) -> List[str]: ...
|
|
156
|
+
def result(self, ctx: PyContext, id: str) -> str: ...
|
|
157
|
+
def add(self, name: str, indicator: Any) -> None: ...
|
|
158
|
+
def get(self, name: str) -> Optional[Any]: ...
|
|
159
|
+
def list_indicators(self) -> List[Tuple[str, str]]: ...
|
|
160
|
+
def update(self, candle: str) -> None: ...
|
|
161
|
+
def reset(self) -> None: ...
|
|
162
|
+
def period(self) -> int: ...
|
|
147
163
|
|
|
148
164
|
class PyBot:
|
|
149
165
|
def __init__(
|
|
150
166
|
self, client: RawPocketOption, strategy: PyStrategy, virtual_market: Optional[PyVirtualMarket] = None
|
|
151
167
|
) -> None: ...
|
|
168
|
+
def with_update_interval(self, millis: int) -> None: ...
|
|
152
169
|
def add_asset(self, asset: str, period: int) -> None: ...
|
|
153
170
|
async def run(self) -> None: ...
|
|
154
171
|
|
|
@@ -0,0 +1,36 @@
|
|
|
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 PocketOptionAsync, PocketOption, __all__ as __pocket_all__ # noqa: F401
|
|
8
|
+
|
|
9
|
+
# Import the Rust module and re-export its attributes
|
|
10
|
+
_rust_module = None
|
|
11
|
+
try:
|
|
12
|
+
_rust_module = importlib.import_module(".BinaryOptionsToolsV2", __package__)
|
|
13
|
+
except (ImportError, ValueError):
|
|
14
|
+
try:
|
|
15
|
+
_rust_module = importlib.import_module("BinaryOptionsToolsV2")
|
|
16
|
+
if _rust_module is sys.modules.get(__package__):
|
|
17
|
+
_rust_module = None
|
|
18
|
+
except ImportError:
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
if _rust_module is not None:
|
|
22
|
+
globals().update({k: v for k, v in _rust_module.__dict__.items() if not k.startswith("_")})
|
|
23
|
+
elif os.environ.get("PYTEST_CURRENT_TEST"):
|
|
24
|
+
print(f"[ERROR] Rust extension module not found (__package__={__package__})")
|
|
25
|
+
|
|
26
|
+
# Names expected from the Rust cdylib; only those actually loaded will be available
|
|
27
|
+
_rust_exported_names = [
|
|
28
|
+
"RawPocketOption", "RawValidator", "RawHandler", "RawHandle",
|
|
29
|
+
"Logger", "LogBuilder", "PyConfig", "PyBot", "PyStrategy",
|
|
30
|
+
"PyContext", "PyVirtualMarket", "Action",
|
|
31
|
+
"StreamLogsIterator", "StreamLogsLayer", "StreamIterator",
|
|
32
|
+
"RawStreamIterator", "start_tracing",
|
|
33
|
+
]
|
|
34
|
+
__rust_all__ = [n for n in _rust_exported_names if n in globals()]
|
|
35
|
+
|
|
36
|
+
__all__ = list(set(__pocket_all__ + ["tracing", "validator", "PocketOptionAsync", "PocketOption"] + __rust_all__))
|
{binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/config.py
RENAMED
|
@@ -1,143 +1,124 @@
|
|
|
1
|
-
import json
|
|
2
|
-
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@dataclass
|
|
18
|
-
class Config:
|
|
19
|
-
"""
|
|
20
|
-
Python wrapper around PyConfig that provides additional functionality
|
|
21
|
-
for configuration management.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
max_allowed_loops: int = 100
|
|
25
|
-
sleep_interval: int = 100
|
|
26
|
-
reconnect_time: int = 5
|
|
27
|
-
connection_initialization_timeout_secs: int = 60
|
|
28
|
-
timeout_secs: int = 30
|
|
29
|
-
urls: List[str] = field(default_factory=list)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
self.
|
|
41
|
-
self.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
self.
|
|
75
|
-
|
|
76
|
-
self.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Returns:
|
|
127
|
-
JSON string containing all configuration values
|
|
128
|
-
"""
|
|
129
|
-
return json.dumps(self.to_dict())
|
|
130
|
-
|
|
131
|
-
def update(self, config_dict: Dict[str, Any]) -> None:
|
|
132
|
-
"""
|
|
133
|
-
Updates the configuration with values from a dictionary.
|
|
134
|
-
|
|
135
|
-
Args:
|
|
136
|
-
config_dict: Dictionary containing new configuration values
|
|
137
|
-
"""
|
|
138
|
-
if self._locked:
|
|
139
|
-
raise RuntimeError("Configuration is locked and cannot be modified after being used")
|
|
140
|
-
|
|
141
|
-
for key, value in config_dict.items():
|
|
142
|
-
if hasattr(self, key):
|
|
143
|
-
setattr(self, key, value)
|
|
1
|
+
import json
|
|
2
|
+
import sys
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from typing import Any, Dict, List
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _get_pyconfig():
|
|
8
|
+
"""Get the PyConfig class from the compiled Rust module via package namespace."""
|
|
9
|
+
pkg = sys.modules.get(__package__ or "")
|
|
10
|
+
if pkg is not None and hasattr(pkg, "PyConfig"):
|
|
11
|
+
return pkg.PyConfig
|
|
12
|
+
import BinaryOptionsToolsV2 as _mod
|
|
13
|
+
|
|
14
|
+
return _mod.PyConfig
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass
|
|
18
|
+
class Config:
|
|
19
|
+
"""
|
|
20
|
+
Python wrapper around PyConfig that provides additional functionality
|
|
21
|
+
for configuration management.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
max_allowed_loops: int = 100
|
|
25
|
+
sleep_interval: int = 100
|
|
26
|
+
reconnect_time: int = 5
|
|
27
|
+
connection_initialization_timeout_secs: int = 60
|
|
28
|
+
timeout_secs: int = 30
|
|
29
|
+
urls: List[str] = field(default_factory=list)
|
|
30
|
+
max_subscriptions: int = 4
|
|
31
|
+
|
|
32
|
+
# Logging configuration
|
|
33
|
+
terminal_logging: bool = False
|
|
34
|
+
log_level: str = "INFO"
|
|
35
|
+
|
|
36
|
+
# Extra duration, used by functions like `check_win`
|
|
37
|
+
extra_duration: int = 5
|
|
38
|
+
|
|
39
|
+
def __post_init__(self):
|
|
40
|
+
self.urls = self.urls or []
|
|
41
|
+
self._pyconfig = None
|
|
42
|
+
self._locked = False
|
|
43
|
+
|
|
44
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
|
45
|
+
if name.startswith("_") or not hasattr(self, "_locked") or not self._locked:
|
|
46
|
+
super().__setattr__(name, value)
|
|
47
|
+
else:
|
|
48
|
+
raise RuntimeError("Configuration is locked and cannot be modified after being used")
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def pyconfig(self) -> Any:
|
|
52
|
+
"""Returns the PyConfig instance for use in Rust code, then locks config."""
|
|
53
|
+
if self._pyconfig is None:
|
|
54
|
+
self._pyconfig = _get_pyconfig()()
|
|
55
|
+
self._sync_pyconfig()
|
|
56
|
+
self._locked = True
|
|
57
|
+
return self._pyconfig
|
|
58
|
+
|
|
59
|
+
def _sync_pyconfig(self):
|
|
60
|
+
"""Sync all Python config fields to the Rust PyConfig instance."""
|
|
61
|
+
if self._pyconfig is None:
|
|
62
|
+
self._pyconfig = _get_pyconfig()()
|
|
63
|
+
|
|
64
|
+
self._pyconfig.max_allowed_loops = self.max_allowed_loops
|
|
65
|
+
self._pyconfig.sleep_interval = self.sleep_interval
|
|
66
|
+
self._pyconfig.reconnect_time = self.reconnect_time
|
|
67
|
+
self._pyconfig.connection_initialization_timeout_secs = self.connection_initialization_timeout_secs
|
|
68
|
+
self._pyconfig.timeout_secs = self.timeout_secs
|
|
69
|
+
self._pyconfig.urls = self.urls
|
|
70
|
+
self._pyconfig.max_subscriptions = self.max_subscriptions
|
|
71
|
+
|
|
72
|
+
def _validate(self):
|
|
73
|
+
"""Validate config values, raising ValueError on invalid input."""
|
|
74
|
+
if self.max_allowed_loops < 0:
|
|
75
|
+
raise ValueError("max_allowed_loops must be non-negative")
|
|
76
|
+
if self.sleep_interval < 0:
|
|
77
|
+
raise ValueError("sleep_interval must be non-negative")
|
|
78
|
+
if self.reconnect_time < 1:
|
|
79
|
+
raise ValueError("reconnect_time must be at least 1 second")
|
|
80
|
+
if self.connection_initialization_timeout_secs < 1:
|
|
81
|
+
raise ValueError("connection_initialization_timeout_secs must be at least 1")
|
|
82
|
+
if self.timeout_secs < 1:
|
|
83
|
+
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
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, config_dict: Dict[str, Any]) -> "Config":
|
|
89
|
+
"""Creates a Config instance from a dictionary."""
|
|
90
|
+
cfg = cls(**{k: v for k, v in config_dict.items() if k in cls.__dataclass_fields__})
|
|
91
|
+
cfg._validate()
|
|
92
|
+
return cfg
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_json(cls, json_str: str) -> "Config":
|
|
96
|
+
"""Creates a Config instance from a JSON string."""
|
|
97
|
+
return cls.from_dict(json.loads(json_str))
|
|
98
|
+
|
|
99
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
100
|
+
"""Converts the configuration to a dictionary."""
|
|
101
|
+
return {
|
|
102
|
+
"max_allowed_loops": self.max_allowed_loops,
|
|
103
|
+
"sleep_interval": self.sleep_interval,
|
|
104
|
+
"reconnect_time": self.reconnect_time,
|
|
105
|
+
"connection_initialization_timeout_secs": self.connection_initialization_timeout_secs,
|
|
106
|
+
"timeout_secs": self.timeout_secs,
|
|
107
|
+
"urls": self.urls,
|
|
108
|
+
"max_subscriptions": self.max_subscriptions,
|
|
109
|
+
"terminal_logging": self.terminal_logging,
|
|
110
|
+
"log_level": self.log_level,
|
|
111
|
+
"extra_duration": self.extra_duration,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
def to_json(self) -> str:
|
|
115
|
+
"""Converts the configuration to a JSON string."""
|
|
116
|
+
return json.dumps(self.to_dict())
|
|
117
|
+
|
|
118
|
+
def update(self, config_dict: Dict[str, Any]) -> None:
|
|
119
|
+
"""Updates config from a dictionary. Raises RuntimeError if locked."""
|
|
120
|
+
if self._locked:
|
|
121
|
+
raise RuntimeError("Configuration is locked and cannot be modified after being used")
|
|
122
|
+
for key, value in config_dict.items():
|
|
123
|
+
if hasattr(self, key):
|
|
124
|
+
setattr(self, key, value)
|