BinaryOptionsToolsV2 0.2.12__tar.gz → 0.2.14__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.

Potentially problematic release.


This version of BinaryOptionsToolsV2 might be problematic. Click here for more details.

Files changed (154) hide show
  1. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/__init__.py +65 -60
  2. binaryoptionstoolsv2-0.2.14/BinaryOptionsToolsV2/closeoption/__init__.py +13 -0
  3. binaryoptionstoolsv2-0.2.14/BinaryOptionsToolsV2/closeoption/asynchronous.py +313 -0
  4. binaryoptionstoolsv2-0.2.14/BinaryOptionsToolsV2/closeoption/synchronous.py +257 -0
  5. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/config.py +12 -5
  6. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/asynchronous.py +306 -23
  7. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/synchronous.py +160 -23
  8. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/Cargo.lock +355 -334
  9. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/Cargo.toml +15 -13
  10. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/LICENSE +2 -2
  11. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/PKG-INFO +88 -76
  12. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/README.md +79 -69
  13. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/.gitignore +4 -0
  14. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/Cargo.toml +20 -11
  15. {binaryoptionstoolsv2-0.2.12/crates/macros → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools}/LICENSE +2 -2
  16. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/Readme.md +6 -1
  17. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/examples/pending_trades_example.rs +651 -0
  18. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/examples/test_demo.rs +114 -0
  19. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/mkds/README.md +94 -0
  20. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/client.rs +734 -0
  21. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/connect.rs +260 -0
  22. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/error.rs +95 -0
  23. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/mod.rs +9 -0
  24. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/state.rs +329 -0
  25. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/types.rs +386 -0
  26. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/src/closeoption/utils.rs +323 -0
  27. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/config.rs +13 -6
  28. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/modules/profile.rs +5 -3
  29. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/types.rs +1 -1
  30. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/lib.rs +84 -81
  31. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/candle.rs +1 -1
  32. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/connect.rs +10 -8
  33. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/error.rs +4 -0
  34. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/deals.rs +3 -1
  35. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/get_candles.rs +34 -3
  36. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/historical_data.rs +12 -4
  37. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/keep_alive.rs +69 -11
  38. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/mod.rs +0 -12
  39. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs +1 -28
  40. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/pocket_client.rs +83 -29
  41. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/state.rs +73 -11
  42. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/utils.rs +342 -41
  43. binaryoptionstoolsv2-0.2.12/crates/binary_options_tools/src/pocketoption/modules/trades_tests/common.rs → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/common/mod.rs +2 -3
  44. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/comprehensive_pocketoption_tests.rs +847 -0
  45. {binaryoptionstoolsv2-0.2.12/crates/binary_options_tools/src/pocketoption/modules/trades_tests → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/concurrency.rs +25 -2
  46. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/deals_module_cleanup.rs +100 -0
  47. {binaryoptionstoolsv2-0.2.12/crates/binary_options_tools/src/pocketoption/modules → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/deals_tests.rs +18 -21
  48. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/history_verification_tests.rs +454 -0
  49. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/mod.rs +5 -0
  50. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/pending_trades_cleanup.rs +69 -0
  51. {binaryoptionstoolsv2-0.2.12/crates/binary_options_tools/src/pocketoption/modules → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/pending_trades_tests.rs +32 -32
  52. {binaryoptionstoolsv2-0.2.12/crates/binary_options_tools/src/pocketoption/modules → binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests}/resilient_parsing_tests.rs +4 -5
  53. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/test_ssid_debug.rs +11 -0
  54. binaryoptionstoolsv2-0.2.14/crates/binary_options_tools/tests/trade_state_regression.rs +72 -0
  55. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/Cargo.toml +6 -6
  56. {binaryoptionstoolsv2-0.2.12/crates/binary_options_tools → binaryoptionstoolsv2-0.2.14/crates/bindings_pyo3}/LICENSE +2 -2
  57. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/Readme.md +25 -34
  58. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/build.rs +11 -1
  59. binaryoptionstoolsv2-0.2.14/crates/bindings_pyo3/src/closeoption.rs +258 -0
  60. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/config.rs +55 -4
  61. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/error.rs +9 -1
  62. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/lib.rs +4 -1
  63. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/pocketoption.rs +64 -4
  64. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/Cargo.toml +5 -5
  65. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/LICENSE +2 -2
  66. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/Cargo.toml +2 -2
  67. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/LICENSE +2 -2
  68. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/client.rs +5 -3
  69. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/signals.rs +10 -6
  70. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/Cargo.toml +11 -11
  71. {binaryoptionstoolsv2-0.2.12/crates/bindings_pyo3 → binaryoptionstoolsv2-0.2.14/crates/macros}/LICENSE +2 -2
  72. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/pyproject.toml +8 -7
  73. binaryoptionstoolsv2-0.2.12/crates/binary_options_tools/src/pocketoption/modules/trades_tests/mod.rs +0 -2
  74. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/BinaryOptionsToolsV2.pyi +0 -0
  75. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/__init__.py +0 -0
  76. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/tools/__init__.py +0 -0
  77. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/pocketoption/tools/login.py +0 -0
  78. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/tracing.py +0 -0
  79. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/BinaryOptionsToolsV2/validator.py +0 -0
  80. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/data/expert_options_regions.json +0 -0
  81. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/data/pocket_options_regions.json +0 -0
  82. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/error.rs +0 -0
  83. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/action.rs +0 -0
  84. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/client.rs +0 -0
  85. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/connect.rs +0 -0
  86. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/error.rs +0 -0
  87. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/mod.rs +0 -0
  88. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/modules/keep_alive.rs +0 -0
  89. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/modules/mod.rs +0 -0
  90. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/regions.rs +0 -0
  91. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/expertoptions/state.rs +0 -0
  92. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/framework/market.rs +0 -0
  93. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/framework/mod.rs +0 -0
  94. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/framework/virtual_market.rs +0 -0
  95. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/mod.rs +0 -0
  96. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/assets.rs +0 -0
  97. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/balance.rs +0 -0
  98. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/pending_trades.rs +0 -0
  99. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/raw.rs +0 -0
  100. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/server_time.rs +0 -0
  101. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/modules/trades.rs +0 -0
  102. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/regions.rs +0 -0
  103. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/ssid.rs +0 -0
  104. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/pocketoption/types.rs +0 -0
  105. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/traits.rs +0 -0
  106. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/utils/mod.rs +0 -0
  107. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/utils/serialize.rs +0 -0
  108. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/binary_options_tools/src/validator.rs +0 -0
  109. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/framework.rs +0 -0
  110. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/logs.rs +0 -0
  111. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/runtime.rs +0 -0
  112. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/stream.rs +0 -0
  113. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/bindings_pyo3/src/validator.rs +0 -0
  114. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/.gitignore +0 -0
  115. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/README.md +0 -0
  116. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/diagrams/architecture.txt +0 -0
  117. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/diagrams/diagram.txt +0 -0
  118. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/docs/testing-framework.md +0 -0
  119. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/examples/echo_client.rs +0 -0
  120. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/examples/middleware_example.rs +0 -0
  121. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/examples/testing_echo_client.rs +0 -0
  122. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/lib.rs +0 -0
  123. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/modules/lightweight.rs +0 -0
  124. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/modules/mod.rs +0 -0
  125. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/macros/src/rule.rs +0 -0
  126. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/builder.rs +0 -0
  127. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/callback.rs +0 -0
  128. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/connector.rs +0 -0
  129. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/error.rs +0 -0
  130. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/lib.rs +0 -0
  131. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/message.rs +0 -0
  132. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/middleware.rs +0 -0
  133. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/reimports.rs +0 -0
  134. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/rules.rs +0 -0
  135. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/statistics.rs +0 -0
  136. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/testing.rs +0 -0
  137. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/traits.rs +0 -0
  138. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/mod.rs +0 -0
  139. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/stream.rs +0 -0
  140. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/time.rs +0 -0
  141. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/src/utils/tracing.rs +0 -0
  142. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/middleware_tests.rs +0 -0
  143. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/rule_macro_tests.rs +0 -0
  144. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/runner_command_tests.rs +0 -0
  145. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/stream_tests.rs +0 -0
  146. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/testing_wrapper_tests.rs +0 -0
  147. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/core/tests/two_step_standalone.rs +0 -0
  148. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/.gitignore +0 -0
  149. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/ActionImpl_README.md +0 -0
  150. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/Cargo.lock +0 -0
  151. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/action.rs +0 -0
  152. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/lib.rs +0 -0
  153. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/region.rs +0 -0
  154. {binaryoptionstoolsv2-0.2.12 → binaryoptionstoolsv2-0.2.14}/crates/macros/src/timeout.rs +0 -0
@@ -1,60 +1,65 @@
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 (
8
- PocketOptionAsync as PocketOptionAsync,
9
- PocketOption as PocketOption,
10
- RawHandler as RawHandler,
11
- Validator as Validator,
12
- __all__ as __pocket_all__,
13
- )
14
-
15
- # Import the Rust module and re-export its attributes
16
- _rust_module = None
17
- try:
18
- _rust_module = importlib.import_module(".BinaryOptionsToolsV2", __package__)
19
- except (ImportError, ValueError):
20
- try:
21
- _rust_module = importlib.import_module("BinaryOptionsToolsV2")
22
- if _rust_module is sys.modules.get(__package__):
23
- _rust_module = None
24
- except ImportError:
25
- pass
26
-
27
- if _rust_module is not None:
28
- globals().update({k: v for k, v in _rust_module.__dict__.items() if not k.startswith("_")})
29
- elif os.environ.get("PYTEST_CURRENT_TEST"):
30
- print(f"[ERROR] Rust extension module not found (__package__={__package__})")
31
-
32
- # Names expected from the Rust cdylib; only those actually loaded will be available
33
- _rust_exported_names = [
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",
51
- ]
52
- __rust_all__ = [n for n in _rust_exported_names if n in globals()]
53
-
54
- __all__ = list(
55
- set(
56
- __pocket_all__
57
- + ["tracing", "validator", "PocketOptionAsync", "PocketOption", "RawHandler", "Validator"]
58
- + __rust_all__
59
- )
60
- )
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 (
8
+ PocketOptionAsync as PocketOptionAsync,
9
+ PocketOption as PocketOption,
10
+ RawHandler as RawHandler,
11
+ Validator as Validator,
12
+ __all__ as __pocket_all__,
13
+ )
14
+ from .closeoption import (
15
+ CloseOptionAsync as CloseOptionAsync,
16
+ CloseOption as CloseOption,
17
+ RawHandler as CloseRawHandler,
18
+ __all__ as __close_all__,
19
+ )
20
+
21
+ # Import the Rust module and re-export its attributes
22
+ _rust_module = None
23
+ try:
24
+ _rust_module = importlib.import_module(".BinaryOptionsToolsV2", __package__)
25
+ except (ImportError, ValueError):
26
+ try:
27
+ _rust_module = importlib.import_module("BinaryOptionsToolsV2")
28
+ if _rust_module is sys.modules.get(__package__):
29
+ _rust_module = None
30
+ except ImportError:
31
+ pass
32
+
33
+ if _rust_module is not None:
34
+ globals().update({k: v for k, v in _rust_module.__dict__.items() if not k.startswith("_")})
35
+ elif os.environ.get("PYTEST_CURRENT_TEST"):
36
+ print(f"[ERROR] Rust extension module not found (__package__={__package__})")
37
+
38
+ # Names expected from the Rust cdylib; only those actually loaded will be available
39
+ _rust_exported_names = [
40
+ "RawPocketOption",
41
+ "RawValidator",
42
+ "RawHandler",
43
+ "RawHandle",
44
+ "Logger",
45
+ "LogBuilder",
46
+ "PyConfig",
47
+ "PyBot",
48
+ "PyStrategy",
49
+ "PyContext",
50
+ "PyVirtualMarket",
51
+ "Action",
52
+ "StreamLogsIterator",
53
+ "StreamLogsLayer",
54
+ "StreamIterator",
55
+ ]
56
+ __rust_all__ = [n for n in _rust_exported_names if n in globals()]
57
+
58
+ __all__ = list(
59
+ set(
60
+ __pocket_all__
61
+ + __close_all__
62
+ + ["tracing", "validator", "PocketOptionAsync", "PocketOption", "CloseOptionAsync", "CloseOption", "RawHandler", "Validator"]
63
+ + __rust_all__
64
+ )
65
+ )
@@ -0,0 +1,13 @@
1
+ from .asynchronous import CloseOptionAsync, AsyncSubscription, AsyncRawSubscription, RawHandler
2
+ from .synchronous import CloseOption, SyncSubscription, SyncRawSubscription, RawHandlerSync
3
+
4
+ __all__ = [
5
+ "CloseOptionAsync",
6
+ "CloseOption",
7
+ "AsyncSubscription",
8
+ "AsyncRawSubscription",
9
+ "SyncSubscription",
10
+ "SyncRawSubscription",
11
+ "RawHandler",
12
+ "RawHandlerSync",
13
+ ]
@@ -0,0 +1,313 @@
1
+ import asyncio
2
+ import json
3
+ import re
4
+ import sys
5
+ import warnings
6
+ from datetime import timedelta
7
+ from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union, AsyncGenerator
8
+
9
+ from ..config import Config
10
+ from ..validator import Validator
11
+
12
+ if TYPE_CHECKING:
13
+ from ..BinaryOptionsToolsV2 import Logger, RawCloseOption
14
+
15
+ if sys.version_info < (3, 10):
16
+
17
+ async def anext(iterator):
18
+ """Polyfill for anext for Python < 3.10"""
19
+ return await iterator.__anext__()
20
+
21
+
22
+ class AsyncSubscription:
23
+ def __init__(self, subscription):
24
+ """Asynchronous Iterator over json objects"""
25
+ self.subscription = subscription
26
+
27
+ def __aiter__(self):
28
+ return self
29
+
30
+ async def __anext__(self):
31
+ return json.loads(await anext(self.subscription))
32
+
33
+
34
+ class AsyncRawSubscription:
35
+ def __init__(self, subscription):
36
+ """Asynchronous Iterator over raw messages"""
37
+ self.subscription = subscription
38
+
39
+ def __aiter__(self):
40
+ return self
41
+
42
+ async def __anext__(self):
43
+ return await anext(self.subscription)
44
+
45
+
46
+ class RawHandler:
47
+ """
48
+ Asynchronous handler for advanced raw WebSocket message operations.
49
+ Provides low-level access to send custom messages and wait for specific responses.
50
+ """
51
+
52
+ def __init__(self, handler):
53
+ self._handler = handler
54
+
55
+ async def send(self, message: str) -> None:
56
+ """Send a raw message through the WebSocket connection."""
57
+ await self._handler.send(message)
58
+
59
+ async def wait_for(self, event: str, timeout: float = 30.0) -> dict:
60
+ """Wait for a specific event from the server."""
61
+ return await self._handler.wait_for(event, timeout)
62
+
63
+ async def subscribe(self, event: str) -> AsyncRawSubscription:
64
+ """Subscribe to a specific event type."""
65
+ sub = await self._handler.subscribe(event)
66
+ return AsyncRawSubscription(sub)
67
+
68
+ async def close(self) -> None:
69
+ """Close the raw handler and release resources."""
70
+ if self._handler:
71
+ await self._handler.close()
72
+ self._handler = None # Release reference to allow Rust Drop
73
+
74
+ async def __aenter__(self):
75
+ return self
76
+
77
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
78
+ await self.close()
79
+
80
+
81
+ def sanitize_and_validate_ssid(ssid: str, logger: "Logger") -> str:
82
+ """Sanitize SSID format and validate session payload semantics."""
83
+ if not ssid or not isinstance(ssid, str):
84
+ raise ValueError("SSID must be a non-empty string")
85
+
86
+ ssid = ssid.strip()
87
+
88
+ # Try to parse as JSON first
89
+ if ssid.startswith('{') and ssid.endswith('}'):
90
+ try:
91
+ data = json.loads(ssid)
92
+ if isinstance(data, dict):
93
+ required = ['token', 'sid']
94
+ if all(k in data for k in required):
95
+ logger.debug("SSID parsed as JSON with token and sid")
96
+ return ssid
97
+ except json.JSONDecodeError:
98
+ pass
99
+
100
+ # Try pipe-delimited format: token|sid|demo|public_code|hidden_code
101
+ parts = ssid.split('|')
102
+ if len(parts) >= 3:
103
+ logger.debug(f"SSID parsed as pipe-delimited with {len(parts)} parts")
104
+ return ssid
105
+
106
+ # If it's just a token, assume it's a simple token
107
+ logger.warning("SSID format not recognized, using as-is")
108
+ return ssid
109
+
110
+
111
+ def parse_ssid(ssid: str) -> Tuple[str, str, bool, str, str]:
112
+ """Parse SSID into token, sid, demo, public_code, hidden_code."""
113
+ # Try JSON first
114
+ if ssid.startswith('{') and ssid.endswith('}'):
115
+ try:
116
+ data = json.loads(ssid)
117
+ if isinstance(data, dict):
118
+ token = data.get('token', '')
119
+ sid = data.get('sid', '')
120
+ demo = data.get('demo', False)
121
+ public_code = data.get('public_code', '')
122
+ hidden_code = data.get('hidden_code', '')
123
+ return token, sid, demo, public_code, hidden_code
124
+ except json.JSONDecodeError:
125
+ pass
126
+
127
+ # Try pipe-delimited
128
+ parts = ssid.split('|')
129
+ if len(parts) >= 3:
130
+ token = parts[0]
131
+ sid = parts[1]
132
+ demo = parts[2].lower() in ('true', '1', 'yes', 'demo') if len(parts) > 2 else False
133
+ public_code = parts[3] if len(parts) > 3 else ''
134
+ hidden_code = parts[4] if len(parts) > 4 else ''
135
+ return token, sid, demo, public_code, hidden_code
136
+
137
+ # Fallback: treat as token only
138
+ return ssid, '', False, '', ''
139
+
140
+
141
+ # This file contains all the async code for the CloseOption Module
142
+ class CloseOptionAsync:
143
+ def __init__(self, ssid: str, url: Optional[str] = None, config: Optional[Union[Config, dict, str]] = None, **_):
144
+ """
145
+ Initialize CloseOption async client.
146
+
147
+ Args:
148
+ ssid: Session ID in format "token|sid|demo|public_code|hidden_code" or JSON
149
+ url: WebSocket URL (optional, defaults to CloseOption)
150
+ config: Configuration object (optional)
151
+ """
152
+ self._ssid = ssid
153
+ self._url = url
154
+ self._config = config if isinstance(config, Config) else Config(config) if config else Config()
155
+ self._validator = Validator()
156
+ self._client = None
157
+ self._raw_handler = None
158
+ self._connected = False
159
+
160
+ async def __aenter__(self):
161
+ await self.connect()
162
+ return self
163
+
164
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
165
+ await self.shutdown()
166
+
167
+ async def connect(self) -> None:
168
+ """Establish connection to CloseOption."""
169
+ if self._connected:
170
+ return
171
+
172
+ from ..BinaryOptionsToolsV2 import RawCloseOption, Logger
173
+
174
+ logger = Logger()
175
+ ssid = sanitize_and_validate_ssid(self._ssid, logger)
176
+ token, sid, demo, public_code, hidden_code = parse_ssid(ssid)
177
+
178
+ if not token or not sid:
179
+ raise ValueError("SSID must contain token and sid")
180
+
181
+ if not public_code or not hidden_code:
182
+ raise ValueError("SSID must contain public_code and hidden_code (format: token|sid|demo|public_code|hidden_code)")
183
+
184
+ # Build URL with sid
185
+ if self._url:
186
+ ws_url = self._url
187
+ else:
188
+ ws_url = f"wss://www.closeoption.com:8443/socket.io/?EIO=3&transport=websocket&sid={sid}"
189
+
190
+ self._client = RawCloseOption(token, sid, public_code, hidden_code, demo, ws_url, self._config.pyconfig)
191
+ await self._client.connect()
192
+ self._connected = True
193
+
194
+ async def _ensure_connected(self):
195
+ if not self._connected:
196
+ await self.connect()
197
+
198
+ async def buy(self, asset: str, amount: float, time: int) -> dict:
199
+ """Place a BUY (CALL) order."""
200
+ await self._ensure_connected()
201
+ result = await self._client.buy(asset, amount, time)
202
+ return json.loads(result)
203
+
204
+ async def sell(self, asset: str, amount: float, time: int) -> dict:
205
+ """Place a SELL (PUT) order."""
206
+ await self._ensure_connected()
207
+ result = await self._client.sell(asset, amount, time)
208
+ return json.loads(result)
209
+
210
+ async def check_win(self, order_id: str) -> dict:
211
+ """Check the result of a trade."""
212
+ await self._ensure_connected()
213
+ result = await self._client.check_win(order_id)
214
+ return json.loads(result)
215
+
216
+ async def balance(self) -> float:
217
+ """Get current balance."""
218
+ await self._ensure_connected()
219
+ result = await self._client.balance()
220
+ return float(result) if result else 0.0
221
+
222
+ async def candles(self, asset: str, period: int) -> List[dict]:
223
+ """Get historical candles."""
224
+ await self._ensure_connected()
225
+ result = await self._client.candles(asset, period)
226
+ return json.loads(result)
227
+
228
+ async def get_candles(self, asset: str, period: int, count: int = 100) -> List[dict]:
229
+ """Get historical candles with count."""
230
+ await self._ensure_connected()
231
+ result = await self._client.get_candles(asset, period, count)
232
+ return json.loads(result)
233
+
234
+ async def get_candles_live(self, asset: str, period: int) -> AsyncGenerator[dict, None]:
235
+ """Get live candle updates."""
236
+ await self._ensure_connected()
237
+ async for candle in self._client.get_candles_live(asset, period):
238
+ yield json.loads(candle)
239
+
240
+ async def subscribe_symbol(self, symbol: str) -> AsyncSubscription:
241
+ """Subscribe to price updates for a symbol."""
242
+ await self._ensure_connected()
243
+ sub = await self._client.subscribe_symbol(symbol)
244
+ return AsyncSubscription(sub)
245
+
246
+ async def subscribe_raw(self) -> AsyncRawSubscription:
247
+ """Subscribe to all raw messages."""
248
+ await self._ensure_connected()
249
+ sub = await self._client.subscribe_raw()
250
+ return AsyncRawSubscription(sub)
251
+
252
+ async def send_raw(self, message: str) -> None:
253
+ """Send a raw message."""
254
+ await self._ensure_connected()
255
+ await self._client.send_raw(message)
256
+
257
+ async def active_assets(self) -> List[dict]:
258
+ """Get list of active assets."""
259
+ await self._ensure_connected()
260
+ result = await self._client.active_assets()
261
+ return json.loads(result)
262
+
263
+ async def payout(self, asset: str) -> float:
264
+ """Get payout for an asset."""
265
+ await self._ensure_connected()
266
+ result = await self._client.payout(asset)
267
+ return float(result)
268
+
269
+ async def history(self, limit: int = 100) -> List[dict]:
270
+ """Get trade history."""
271
+ await self._ensure_connected()
272
+ result = await self._client.history(limit)
273
+ return json.loads(result)
274
+
275
+ async def opened_deals(self) -> List[dict]:
276
+ """Get opened deals."""
277
+ await self._ensure_connected()
278
+ result = await self._client.opened_deals()
279
+ return json.loads(result)
280
+
281
+ async def closed_deals(self) -> List[dict]:
282
+ """Get closed deals."""
283
+ await self._ensure_connected()
284
+ result = await self._client.closed_deals()
285
+ return json.loads(result)
286
+
287
+ async def get_server_time(self) -> int:
288
+ """Get server time."""
289
+ await self._ensure_connected()
290
+ result = await self._client.get_server_time()
291
+ return int(result)
292
+
293
+ async def raw_handler(self) -> RawHandler:
294
+ """Get raw handler for advanced operations."""
295
+ await self._ensure_connected()
296
+ if self._raw_handler is None:
297
+ handler = await self._client.raw_handler()
298
+ self._raw_handler = RawHandler(handler)
299
+ return self._raw_handler
300
+
301
+ async def shutdown(self) -> None:
302
+ """Close the connection and cleanup."""
303
+ if self._raw_handler:
304
+ await self._raw_handler.close()
305
+ self._raw_handler = None
306
+ if self._client:
307
+ await self._client.shutdown()
308
+ self._client = None
309
+ self._connected = False
310
+
311
+ async def reconnect(self) -> None:
312
+ """Reconnect to the server."""
313
+ await self._client.reconnect()