binaryoptionstoolsv2 0.2.9__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 (183) hide show
  1. {binaryoptionstoolsv2-0.2.9/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +19 -2
  2. binaryoptionstoolsv2-0.2.11/BinaryOptionsToolsV2/__init__.py +36 -0
  3. {binaryoptionstoolsv2-0.2.9/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/config.py +38 -65
  4. {binaryoptionstoolsv2-0.2.9/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +404 -281
  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.9 → binaryoptionstoolsv2-0.2.11}/Cargo.lock +381 -405
  9. binaryoptionstoolsv2-0.2.11/Cargo.toml +41 -0
  10. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11}/LICENSE +100 -100
  11. {binaryoptionstoolsv2-0.2.9 → 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.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/config.rs +6 -0
  14. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/error.rs +5 -1
  15. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/action.rs +1 -1
  16. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/client.rs +1 -1
  17. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/connect.rs +3 -3
  18. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/error.rs +1 -1
  19. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +5 -16
  20. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +5 -5
  21. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/state.rs +1 -1
  22. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/types.rs +2 -2
  23. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/virtual_market.rs +5 -5
  24. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/lib.rs +3 -3
  25. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/candle.rs +285 -15
  26. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/connect.rs +3 -3
  27. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/error.rs +7 -1
  28. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +265 -263
  29. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +101 -84
  30. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +207 -74
  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.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +4 -2
  35. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +3 -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.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +104 -53
  39. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/resilient_parsing_tests.rs +3 -4
  40. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +84 -66
  41. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +253 -198
  42. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +68 -28
  43. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs +3 -3
  44. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/concurrency.rs +1 -1
  45. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +115 -149
  46. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/ssid.rs +213 -11
  47. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/state.rs +43 -20
  48. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/types.rs +41 -17
  49. binaryoptionstoolsv2-0.2.11/crates/binary_options_tools/src/pocketoption/utils.rs +445 -0
  50. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/utils/mod.rs +1 -1
  51. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/Cargo.toml +19 -18
  52. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/build.rs +1 -0
  53. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/config.rs +10 -0
  54. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/error.rs +15 -2
  55. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/framework.rs +2 -2
  56. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/lib.rs +12 -0
  57. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/logs.rs +4 -4
  58. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/pocketoption.rs +119 -40
  59. {binaryoptionstoolsv2-0.2.9/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.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/README.md +2 -2
  63. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/diagrams/architecture.txt +51 -51
  64. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/diagrams/diagram.txt +40 -40
  65. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/docs/testing-framework.md +10 -10
  66. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/basic_connector_usage.rs +72 -72
  67. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/echo_client.rs +6 -6
  68. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/examples/middleware_example.rs +6 -6
  69. {binaryoptionstoolsv2-0.2.9/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.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/builder.rs +13 -12
  77. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/callback.rs +51 -51
  78. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/client.rs +140 -155
  79. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/connector.rs +52 -52
  80. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/error.rs +51 -49
  81. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/lib.rs +3 -0
  82. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/message.rs +1 -1
  83. {binaryoptionstoolsv2-0.2.9/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.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/statistics.rs +8 -18
  86. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/testing.rs +623 -623
  87. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/traits.rs +250 -233
  88. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/stream.rs +8 -4
  89. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/time.rs +20 -20
  90. {binaryoptionstoolsv2-0.2.9/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.9/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.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/Cargo.toml +11 -11
  97. {binaryoptionstoolsv2-0.2.9 → 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.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/lib.rs +21 -3
  101. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/region.rs +10 -1
  102. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/timeout.rs +1 -1
  103. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/pyproject.toml +3 -3
  104. binaryoptionstoolsv2-0.2.9/Cargo.toml +0 -18
  105. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/Cargo.lock +0 -2498
  106. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/Cargo.toml +0 -46
  107. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +0 -348
  108. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +0 -1041
  109. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +0 -332
  110. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/modules/pending_trades_tests.rs +0 -805
  111. binaryoptionstoolsv2-0.2.9/crates/binary_options_tools/src/pocketoption/utils.rs +0 -226
  112. binaryoptionstoolsv2-0.2.9/crates/core/Cargo.lock +0 -1994
  113. binaryoptionstoolsv2-0.2.9/crates/core/Cargo.toml +0 -38
  114. binaryoptionstoolsv2-0.2.9/crates/core/LICENSE +0 -100
  115. binaryoptionstoolsv2-0.2.9/crates/core/data/batching.rs +0 -218
  116. binaryoptionstoolsv2-0.2.9/crates/core/data/client2.rs +0 -1001
  117. binaryoptionstoolsv2-0.2.9/crates/core/data/client_enhanced.rs +0 -1011
  118. binaryoptionstoolsv2-0.2.9/crates/core/data/connection.rs +0 -294
  119. binaryoptionstoolsv2-0.2.9/crates/core/data/events.rs +0 -242
  120. binaryoptionstoolsv2-0.2.9/crates/core/data/websocket_config.rs +0 -228
  121. binaryoptionstoolsv2-0.2.9/crates/core/errors.log +0 -0
  122. binaryoptionstoolsv2-0.2.9/crates/core/readme.md +0 -37
  123. binaryoptionstoolsv2-0.2.9/crates/core/src/constants.rs +0 -7
  124. binaryoptionstoolsv2-0.2.9/crates/core/src/error.rs +0 -82
  125. binaryoptionstoolsv2-0.2.9/crates/core/src/general/client.rs +0 -700
  126. binaryoptionstoolsv2-0.2.9/crates/core/src/general/config.rs +0 -63
  127. binaryoptionstoolsv2-0.2.9/crates/core/src/general/mod.rs +0 -8
  128. binaryoptionstoolsv2-0.2.9/crates/core/src/general/send.rs +0 -304
  129. binaryoptionstoolsv2-0.2.9/crates/core/src/general/stream.rs +0 -121
  130. binaryoptionstoolsv2-0.2.9/crates/core/src/general/traits.rs +0 -113
  131. binaryoptionstoolsv2-0.2.9/crates/core/src/general/types.rs +0 -163
  132. binaryoptionstoolsv2-0.2.9/crates/core/src/general/validate.rs +0 -19
  133. binaryoptionstoolsv2-0.2.9/crates/core/src/lib.rs +0 -9
  134. binaryoptionstoolsv2-0.2.9/crates/core/src/reimports.rs +0 -5
  135. binaryoptionstoolsv2-0.2.9/crates/core/src/utils/mod.rs +0 -2
  136. binaryoptionstoolsv2-0.2.9/crates/core/src/utils/time.rs +0 -19
  137. binaryoptionstoolsv2-0.2.9/crates/core/src/utils/tracing.rs +0 -109
  138. binaryoptionstoolsv2-0.2.9/crates/core-pre/.vscode/mcp.json +0 -13
  139. binaryoptionstoolsv2-0.2.9/crates/core-pre/Cargo.toml +0 -26
  140. binaryoptionstoolsv2-0.2.9/crates/macros/.gitignore +0 -2
  141. binaryoptionstoolsv2-0.2.9/crates/macros/LICENSE +0 -100
  142. binaryoptionstoolsv2-0.2.9/crates/macros/src/impls/config_impl.rs +0 -7
  143. binaryoptionstoolsv2-0.2.9/crates/macros/src/impls/mod.rs +0 -1
  144. binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/__init__.py +0 -54
  145. binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/pocketoption/synchronous.py +0 -724
  146. binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/tracing.py +0 -96
  147. binaryoptionstoolsv2-0.2.9/python/BinaryOptionsToolsV2/validator.py +0 -198
  148. {binaryoptionstoolsv2-0.2.9/python → binaryoptionstoolsv2-0.2.11}/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -0
  149. /binaryoptionstoolsv2-0.2.9/Readme.md → /binaryoptionstoolsv2-0.2.11/README.md +0 -0
  150. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/binary_options_tools}/LICENSE +0 -0
  151. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/Readme.md +0 -0
  152. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
  153. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
  154. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
  155. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
  156. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
  157. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/market.rs +0 -0
  158. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/framework/mod.rs +0 -0
  159. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
  160. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +0 -0
  161. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
  162. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/reimports.rs +0 -0
  163. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/traits.rs +0 -0
  164. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
  165. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/binary_options_tools/src/validator.rs +0 -0
  166. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/LICENSE +0 -0
  167. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/Readme.md +0 -0
  168. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/runtime.rs +0 -0
  169. {binaryoptionstoolsv2-0.2.9/BinaryOptionsToolsV2/rust → binaryoptionstoolsv2-0.2.11/crates/bindings_pyo3}/src/stream.rs +0 -0
  170. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/.gitignore +0 -0
  171. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/reimports.rs +0 -0
  172. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/signals.rs +0 -0
  173. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/mod.rs +0 -0
  174. {binaryoptionstoolsv2-0.2.9/crates/core-pre → binaryoptionstoolsv2-0.2.11/crates/core}/src/utils/tracing.rs +0 -0
  175. {binaryoptionstoolsv2-0.2.9/crates/core → binaryoptionstoolsv2-0.2.11/crates/macros}/.gitignore +0 -0
  176. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/ActionImpl_README.md +0 -0
  177. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/Cargo.lock +0 -0
  178. {binaryoptionstoolsv2-0.2.9/crates/binary_options_tools → binaryoptionstoolsv2-0.2.11/crates/macros}/LICENSE +0 -0
  179. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/examples/action_example.rs +0 -0
  180. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/readme.md +0 -0
  181. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/config.rs +0 -0
  182. {binaryoptionstoolsv2-0.2.9 → binaryoptionstoolsv2-0.2.11}/crates/macros/src/deserialize.rs +0 -0
  183. {binaryoptionstoolsv2-0.2.9 → 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,25 +1,17 @@
1
1
  import json
2
+ import sys
2
3
  from dataclasses import dataclass, field
3
4
  from typing import Any, Dict, List
4
5
 
5
6
 
6
7
  def _get_pyconfig():
7
- """Helper to get the PyConfig class from the compiled Rust module."""
8
- try:
9
- # First try to import from the package
10
- from . import 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
11
13
 
12
- return PyConfig
13
- except (ImportError, AttributeError):
14
- # Fallback to direct import
15
- try:
16
- from ..BinaryOptionsToolsV2 import PyConfig
17
-
18
- return PyConfig
19
- except ImportError:
20
- import BinaryOptionsToolsV2
21
-
22
- return getattr(BinaryOptionsToolsV2, "PyConfig")
14
+ return _mod.PyConfig
23
15
 
24
16
 
25
17
  @dataclass
@@ -35,6 +27,7 @@ class Config:
35
27
  connection_initialization_timeout_secs: int = 60
36
28
  timeout_secs: int = 30
37
29
  urls: List[str] = field(default_factory=list)
30
+ max_subscriptions: int = 4
38
31
 
39
32
  # Logging configuration
40
33
  terminal_logging: bool = False
@@ -49,8 +42,6 @@ class Config:
49
42
  self._locked = False
50
43
 
51
44
  def __setattr__(self, name: str, value: Any) -> None:
52
- """Override setattr to check for locked state"""
53
- # Allow setting private attributes and during initialization
54
45
  if name.startswith("_") or not hasattr(self, "_locked") or not self._locked:
55
46
  super().__setattr__(name, value)
56
47
  else:
@@ -58,21 +49,15 @@ class Config:
58
49
 
59
50
  @property
60
51
  def pyconfig(self) -> Any:
61
- """
62
- Returns the PyConfig instance for use in Rust code.
63
- Once this is accessed, the configuration becomes locked.
64
- """
52
+ """Returns the PyConfig instance for use in Rust code, then locks config."""
65
53
  if self._pyconfig is None:
66
54
  self._pyconfig = _get_pyconfig()()
67
- self._update_pyconfig()
55
+ self._sync_pyconfig()
68
56
  self._locked = True
69
57
  return self._pyconfig
70
58
 
71
- def _update_pyconfig(self):
72
- """Updates the internal PyConfig with current values"""
73
- if self._locked:
74
- raise RuntimeError("Configuration is locked and cannot be modified after being used")
75
-
59
+ def _sync_pyconfig(self):
60
+ """Sync all Python config fields to the Rust PyConfig instance."""
76
61
  if self._pyconfig is None:
77
62
  self._pyconfig = _get_pyconfig()()
78
63
 
@@ -82,40 +67,37 @@ class Config:
82
67
  self._pyconfig.connection_initialization_timeout_secs = self.connection_initialization_timeout_secs
83
68
  self._pyconfig.timeout_secs = self.timeout_secs
84
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")
85
86
 
86
87
  @classmethod
87
88
  def from_dict(cls, config_dict: Dict[str, Any]) -> "Config":
88
- """
89
- Creates a Config instance from a dictionary.
90
-
91
- Args:
92
- config_dict: Dictionary containing configuration values
93
-
94
- Returns:
95
- Config instance
96
- """
97
- return cls(**{k: v for k, v in config_dict.items() if k in Config.__dataclass_fields__})
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
98
93
 
99
94
  @classmethod
100
95
  def from_json(cls, json_str: str) -> "Config":
101
- """
102
- Creates a Config instance from a JSON string.
103
-
104
- Args:
105
- json_str: JSON string containing configuration values
106
-
107
- Returns:
108
- Config instance
109
- """
96
+ """Creates a Config instance from a JSON string."""
110
97
  return cls.from_dict(json.loads(json_str))
111
98
 
112
99
  def to_dict(self) -> Dict[str, Any]:
113
- """
114
- Converts the configuration to a dictionary.
115
-
116
- Returns:
117
- Dictionary containing all configuration values
118
- """
100
+ """Converts the configuration to a dictionary."""
119
101
  return {
120
102
  "max_allowed_loops": self.max_allowed_loops,
121
103
  "sleep_interval": self.sleep_interval,
@@ -123,29 +105,20 @@ class Config:
123
105
  "connection_initialization_timeout_secs": self.connection_initialization_timeout_secs,
124
106
  "timeout_secs": self.timeout_secs,
125
107
  "urls": self.urls,
108
+ "max_subscriptions": self.max_subscriptions,
126
109
  "terminal_logging": self.terminal_logging,
127
110
  "log_level": self.log_level,
111
+ "extra_duration": self.extra_duration,
128
112
  }
129
113
 
130
114
  def to_json(self) -> str:
131
- """
132
- Converts the configuration to a JSON string.
133
-
134
- Returns:
135
- JSON string containing all configuration values
136
- """
115
+ """Converts the configuration to a JSON string."""
137
116
  return json.dumps(self.to_dict())
138
117
 
139
118
  def update(self, config_dict: Dict[str, Any]) -> None:
140
- """
141
- Updates the configuration with values from a dictionary.
142
-
143
- Args:
144
- config_dict: Dictionary containing new configuration values
145
- """
119
+ """Updates config from a dictionary. Raises RuntimeError if locked."""
146
120
  if self._locked:
147
121
  raise RuntimeError("Configuration is locked and cannot be modified after being used")
148
-
149
122
  for key, value in config_dict.items():
150
123
  if hasattr(self, key):
151
124
  setattr(self, key, value)