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.
Files changed (156) hide show
  1. {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +19 -2
  2. binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/__init__.py +36 -0
  3. {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/config.py +124 -143
  4. {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +405 -282
  5. binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/pocketoption/synchronous.py +287 -0
  6. binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/tracing.py +91 -0
  7. binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/validator.py +80 -0
  8. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11}/Cargo.lock +831 -338
  9. binaryoptionstoolsv2-0.2.11/Cargo.toml +41 -0
  10. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11}/LICENSE +100 -100
  11. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/PKG-INFO +1 -1
  12. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/Cargo.toml +46 -0
  13. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/config.rs +6 -0
  14. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/error.rs +37 -0
  15. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/action.rs +1 -1
  16. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/client.rs +1 -1
  17. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/connect.rs +3 -3
  18. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/error.rs +1 -1
  19. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +5 -16
  20. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +5 -5
  21. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/state.rs +1 -1
  22. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/types.rs +2 -2
  23. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/virtual_market.rs +5 -5
  24. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/lib.rs +3 -3
  25. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/candle.rs +285 -15
  26. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/connect.rs +3 -3
  27. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/error.rs +7 -1
  28. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +265 -263
  29. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +101 -84
  30. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +114 -61
  31. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/deals_tests.rs +147 -0
  32. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +704 -0
  33. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +500 -0
  34. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +13 -3
  35. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +6 -0
  36. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +523 -0
  37. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +1091 -0
  38. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +104 -53
  39. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/modules/resilient_parsing_tests.rs +117 -0
  40. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +84 -66
  41. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +261 -209
  42. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +86 -28
  43. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs +3 -3
  44. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/concurrency.rs +40 -16
  45. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +159 -106
  46. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/ssid.rs +251 -27
  47. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/state.rs +431 -405
  48. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/types.rs +57 -24
  49. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/utils.rs +445 -0
  50. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/utils/mod.rs +1 -1
  51. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/Cargo.toml +19 -18
  52. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/build.rs +6 -2
  53. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/config.rs +10 -0
  54. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/error.rs +15 -2
  55. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/framework.rs +120 -141
  56. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/lib.rs +12 -0
  57. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/logs.rs +4 -4
  58. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/pocketoption.rs +127 -42
  59. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/validator.rs +2 -49
  60. binaryoptionstoolsv2-0.2.11/crates/core/Cargo.toml +35 -0
  61. binaryoptionstoolsv2-0.2.11/crates/core/LICENSE +100 -0
  62. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/README.md +2 -2
  63. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/diagrams/architecture.txt +51 -51
  64. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/diagrams/diagram.txt +40 -40
  65. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/docs/testing-framework.md +10 -10
  66. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/basic_connector_usage.rs +72 -72
  67. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/echo_client.rs +6 -6
  68. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/middleware_example.rs +6 -6
  69. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/testing_echo_client.rs +7 -7
  70. binaryoptionstoolsv2-0.2.11/crates/core/macros/Cargo.toml +14 -0
  71. binaryoptionstoolsv2-0.2.11/crates/core/macros/LICENSE +100 -0
  72. binaryoptionstoolsv2-0.2.11/crates/core/macros/src/lib.rs +184 -0
  73. binaryoptionstoolsv2-0.2.11/crates/core/macros/src/modules/lightweight.rs +7 -0
  74. binaryoptionstoolsv2-0.2.11/crates/core/macros/src/modules/mod.rs +1 -0
  75. binaryoptionstoolsv2-0.2.11/crates/core/macros/src/rule.rs +570 -0
  76. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/builder.rs +28 -27
  77. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/callback.rs +51 -51
  78. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/client.rs +140 -155
  79. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/connector.rs +52 -52
  80. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/error.rs +51 -49
  81. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/lib.rs +3 -0
  82. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/message.rs +1 -1
  83. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/middleware.rs +502 -502
  84. binaryoptionstoolsv2-0.2.11/crates/core/src/rules.rs +783 -0
  85. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/statistics.rs +8 -18
  86. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/testing.rs +623 -623
  87. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/traits.rs +250 -233
  88. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/stream.rs +8 -4
  89. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/time.rs +20 -20
  90. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/tests/middleware_tests.rs +3 -3
  91. binaryoptionstoolsv2-0.2.11/crates/core/tests/rule_macro_tests.rs +860 -0
  92. binaryoptionstoolsv2-0.2.11/crates/core/tests/runner_command_tests.rs +169 -0
  93. binaryoptionstoolsv2-0.2.11/crates/core/tests/stream_tests.rs +67 -0
  94. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/tests/testing_wrapper_tests.rs +196 -198
  95. binaryoptionstoolsv2-0.2.11/crates/core/tests/two_step_standalone.rs +185 -0
  96. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/Cargo.toml +11 -11
  97. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/action.rs +3 -3
  98. binaryoptionstoolsv2-0.2.11/crates/macros/src/impls/mod.rs +1 -0
  99. binaryoptionstoolsv2-0.2.11/crates/macros/src/impls/module_impl.rs +31 -0
  100. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/lib.rs +21 -3
  101. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/region.rs +10 -1
  102. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/timeout.rs +1 -1
  103. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/pyproject.toml +3 -3
  104. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/Cargo.lock +0 -2498
  105. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/Cargo.toml +0 -47
  106. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/error.rs +0 -79
  107. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +0 -348
  108. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +0 -1041
  109. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +0 -328
  110. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +0 -805
  111. binaryoptionstoolsv2-0.2.8/crates/binary_options_tools/src/pocketoption/utils.rs +0 -223
  112. binaryoptionstoolsv2-0.2.8/crates/core-pre/.vscode/mcp.json +0 -13
  113. binaryoptionstoolsv2-0.2.8/crates/core-pre/Cargo.toml +0 -26
  114. binaryoptionstoolsv2-0.2.8/crates/macros/LICENSE +0 -100
  115. binaryoptionstoolsv2-0.2.8/crates/macros/src/impls/config_impl.rs +0 -7
  116. binaryoptionstoolsv2-0.2.8/crates/macros/src/impls/mod.rs +0 -1
  117. binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/__init__.py +0 -54
  118. binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/pocketoption/synchronous.py +0 -724
  119. binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/tracing.py +0 -159
  120. binaryoptionstoolsv2-0.2.8/python/BinaryOptionsToolsV2/validator.py +0 -271
  121. {binaryoptionstoolsv2-0.2.8/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -0
  122. /binaryoptionstoolsv2-0.2.8/Readme.md → /binaryoptionstoolsv2-0.2.11/README.md +0 -0
  123. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/binary_options_tools}/LICENSE +0 -0
  124. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/Readme.md +0 -0
  125. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
  126. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
  127. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
  128. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
  129. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
  130. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/market.rs +0 -0
  131. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/mod.rs +0 -0
  132. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
  133. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +0 -0
  134. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
  135. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/reimports.rs +0 -0
  136. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/traits.rs +0 -0
  137. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
  138. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/validator.rs +0 -0
  139. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/LICENSE +0 -0
  140. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/Readme.md +0 -0
  141. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/runtime.rs +0 -0
  142. {binaryoptionstoolsv2-0.2.8/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/stream.rs +0 -0
  143. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/.gitignore +0 -0
  144. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/reimports.rs +0 -0
  145. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/signals.rs +0 -0
  146. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/mod.rs +0 -0
  147. {binaryoptionstoolsv2-0.2.8/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/tracing.rs +0 -0
  148. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/.gitignore +0 -0
  149. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/ActionImpl_README.md +0 -0
  150. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/Cargo.lock +0 -0
  151. {binaryoptionstoolsv2-0.2.8/crates/binary_options_tools → binaryoptionstoolsv2-0.2.11/crates/macros}/LICENSE +0 -0
  152. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/examples/action_example.rs +0 -0
  153. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/readme.md +0 -0
  154. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/config.rs +0 -0
  155. {binaryoptionstoolsv2-0.2.8 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/deserialize.rs +0 -0
  156. {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 subscribe_symbol_chuncked(self, symbol: str, chunck_size: int) -> StreamIterator: ...
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__))
@@ -1,143 +1,124 @@
1
- import json
2
- from dataclasses import dataclass, field
3
- from typing import Any, Dict, List
4
-
5
-
6
- def _get_pyconfig():
7
- try:
8
- from .BinaryOptionsToolsV2 import PyConfig
9
-
10
- return PyConfig
11
- except ImportError:
12
- import BinaryOptionsToolsV2
13
-
14
- return getattr(BinaryOptionsToolsV2, "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
-
31
- # Logging configuration
32
- terminal_logging: bool = False
33
- log_level: str = "INFO"
34
-
35
- # Extra duration, used by functions like `check_win`
36
- extra_duration: int = 5
37
-
38
- def __post_init__(self):
39
- self.urls = self.urls or []
40
- self._pyconfig = None
41
- self._locked = False
42
-
43
- def __setattr__(self, name: str, value: Any) -> None:
44
- """Override setattr to check for locked state"""
45
- # Allow setting private attributes and during initialization
46
- if name.startswith("_") or not hasattr(self, "_locked") or not self._locked:
47
- super().__setattr__(name, value)
48
- else:
49
- raise RuntimeError("Configuration is locked and cannot be modified after being used")
50
-
51
- @property
52
- def pyconfig(self) -> Any:
53
- """
54
- Returns the PyConfig instance for use in Rust code.
55
- Once this is accessed, the configuration becomes locked.
56
- """
57
- if self._pyconfig is None:
58
- self._pyconfig = _get_pyconfig()()
59
- self._update_pyconfig()
60
- self._locked = True
61
- return self._pyconfig
62
-
63
- def _update_pyconfig(self):
64
- """Updates the internal PyConfig with current values"""
65
- if self._locked:
66
- raise RuntimeError("Configuration is locked and cannot be modified after being used")
67
-
68
- if self._pyconfig is None:
69
- self._pyconfig = _get_pyconfig()()
70
-
71
- self._pyconfig.max_allowed_loops = self.max_allowed_loops
72
- self._pyconfig.sleep_interval = self.sleep_interval
73
- self._pyconfig.reconnect_time = self.reconnect_time
74
- self._pyconfig.connection_initialization_timeout_secs = self.connection_initialization_timeout_secs
75
- self._pyconfig.timeout_secs = self.timeout_secs
76
- self._pyconfig.urls = self.urls
77
-
78
- @classmethod
79
- def from_dict(cls, config_dict: Dict[str, Any]) -> "Config":
80
- """
81
- Creates a Config instance from a dictionary.
82
-
83
- Args:
84
- config_dict: Dictionary containing configuration values
85
-
86
- Returns:
87
- Config instance
88
- """
89
- return cls(**{k: v for k, v in config_dict.items() if k in Config.__dataclass_fields__})
90
-
91
- @classmethod
92
- def from_json(cls, json_str: str) -> "Config":
93
- """
94
- Creates a Config instance from a JSON string.
95
-
96
- Args:
97
- json_str: JSON string containing configuration values
98
-
99
- Returns:
100
- Config instance
101
- """
102
- return cls.from_dict(json.loads(json_str))
103
-
104
- def to_dict(self) -> Dict[str, Any]:
105
- """
106
- Converts the configuration to a dictionary.
107
-
108
- Returns:
109
- Dictionary containing all configuration values
110
- """
111
- return {
112
- "max_allowed_loops": self.max_allowed_loops,
113
- "sleep_interval": self.sleep_interval,
114
- "reconnect_time": self.reconnect_time,
115
- "connection_initialization_timeout_secs": self.connection_initialization_timeout_secs,
116
- "timeout_secs": self.timeout_secs,
117
- "urls": self.urls,
118
- "terminal_logging": self.terminal_logging,
119
- "log_level": self.log_level,
120
- }
121
-
122
- def to_json(self) -> str:
123
- """
124
- Converts the configuration to a JSON string.
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)