webull-openapi-python-sdk 2.0.3__tar.gz → 2.0.4__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 (265) hide show
  1. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/PKG-INFO +1 -1
  2. webull_openapi_python_sdk-2.0.4/samples/__init__.py +1 -0
  3. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/trade/trade_client_v3.py +11 -2
  4. webull_openapi_python_sdk-2.0.4/webull/__init__.py +1 -0
  5. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/__init__.py +1 -1
  6. webull_openapi_python_sdk-2.0.4/webull/core/auth/algorithm/sha_hmac256_new.py +64 -0
  7. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/composer/default_signature_composer.py +19 -10
  8. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/utils/common.py +16 -1
  9. webull_openapi_python_sdk-2.0.4/webull/data/__init__.py +3 -0
  10. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/category.py +1 -0
  11. webull_openapi_python_sdk-2.0.4/webull/trade/__init__.py +1 -0
  12. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/category.py +1 -0
  13. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/events/signature_composer.py +10 -6
  14. webull_openapi_python_sdk-2.0.4/webull/trade/request/v2/get_account_position_details_request.py +35 -0
  15. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/v2/account_info_v2.py +17 -3
  16. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/v3/order_opration_v3.py +7 -7
  17. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade_events_client.py +27 -2
  18. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull_openapi_python_sdk.egg-info/PKG-INFO +1 -1
  19. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull_openapi_python_sdk.egg-info/SOURCES.txt +2 -0
  20. webull_openapi_python_sdk-2.0.3/samples/__init__.py +0 -1
  21. webull_openapi_python_sdk-2.0.3/webull/__init__.py +0 -1
  22. webull_openapi_python_sdk-2.0.3/webull/data/__init__.py +0 -3
  23. webull_openapi_python_sdk-2.0.3/webull/trade/__init__.py +0 -1
  24. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/ChangeLog.txt +0 -0
  25. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/LICENSE +0 -0
  26. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/MANIFEST.in +0 -0
  27. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/NOTICE +0 -0
  28. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/README.rst +0 -0
  29. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/account/__init__.py +0 -0
  30. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/account/account_client.py +0 -0
  31. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/assets/__init__.py +0 -0
  32. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/assets/assets_client.py +0 -0
  33. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/data/__init__.py +0 -0
  34. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/data/data_client.py +0 -0
  35. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/data/data_client_event.py +0 -0
  36. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/data/data_streaming_client.py +0 -0
  37. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/data/data_streaming_client_async.py +0 -0
  38. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/data/data_streaming_client_event.py +0 -0
  39. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/order/__init__.py +0 -0
  40. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/order/order_option_client.py +0 -0
  41. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/order/order_stock_client.py +0 -0
  42. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/trade/__init__.py +0 -0
  43. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/trade/trade_client.py +0 -0
  44. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/trade/trade_client_v2.py +0 -0
  45. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/trade/trade_client_v3_event.py +0 -0
  46. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/samples/trade/trade_event_client.py +0 -0
  47. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/setup.cfg +0 -0
  48. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/setup.py +0 -0
  49. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/__init__.py +0 -0
  50. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/algorithm/__init__.py +0 -0
  51. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/algorithm/sha_hmac1.py +0 -0
  52. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/algorithm/sha_hmac256.py +0 -0
  53. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/composer/__init__.py +0 -0
  54. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/credentials.py +0 -0
  55. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/signers/__init__.py +0 -0
  56. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/signers/app_key_signer.py +0 -0
  57. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/signers/signer.py +0 -0
  58. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/auth/signers/signer_factory.py +0 -0
  59. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/cache/__init__.py +0 -0
  60. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/client.py +0 -0
  61. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/common/__init__.py +0 -0
  62. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/common/api_type.py +0 -0
  63. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/common/easy_enum.py +0 -0
  64. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/common/region.py +0 -0
  65. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/compat.py +0 -0
  66. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/context/__init__.py +0 -0
  67. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/context/request_context_holder.py +0 -0
  68. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/data/endpoints.json +0 -0
  69. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/data/retry_config.json +0 -0
  70. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/endpoint/__init__.py +0 -0
  71. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/endpoint/chained_endpoint_resolver.py +0 -0
  72. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/endpoint/default_endpoint_resolver.py +0 -0
  73. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/endpoint/local_config_regional_endpoint_resolver.py +0 -0
  74. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/endpoint/resolver_endpoint_request.py +0 -0
  75. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/endpoint/user_customized_endpoint_resolver.py +0 -0
  76. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/exception/__init__.py +0 -0
  77. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/exception/error_code.py +0 -0
  78. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/exception/error_msg.py +0 -0
  79. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/exception/exceptions.py +0 -0
  80. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/headers.py +0 -0
  81. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/__init__.py +0 -0
  82. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/__init__.py +0 -0
  83. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/client_initializer.py +0 -0
  84. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/config/__init__.py +0 -0
  85. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/config/bean/__init__.py +0 -0
  86. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/config/bean/query_config_request.py +0 -0
  87. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/config/config_operation.py +0 -0
  88. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/__init__.py +0 -0
  89. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/bean/__init__.py +0 -0
  90. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/bean/access_token.py +0 -0
  91. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/bean/check_token_request.py +0 -0
  92. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/bean/create_token_request.py +0 -0
  93. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/bean/refresh_token_request.py +0 -0
  94. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/token_manager.py +0 -0
  95. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/token_operation.py +0 -0
  96. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/initializer/token/token_storage.py +0 -0
  97. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/method_type.py +0 -0
  98. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/protocol_type.py +0 -0
  99. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/request.py +0 -0
  100. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/http/response.py +0 -0
  101. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/request.py +0 -0
  102. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/retry/__init__.py +0 -0
  103. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/retry/backoff_strategy.py +0 -0
  104. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/retry/retry_condition.py +0 -0
  105. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/retry/retry_policy.py +0 -0
  106. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/retry/retry_policy_context.py +0 -0
  107. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/utils/__init__.py +0 -0
  108. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/utils/data.py +0 -0
  109. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/utils/desensitize.py +0 -0
  110. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/core/utils/validation.py +0 -0
  111. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/__init__.py +0 -0
  112. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/connect_ack.py +0 -0
  113. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/contract_type.py +0 -0
  114. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/direction.py +0 -0
  115. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/exchange_code.py +0 -0
  116. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/exercise_style.py +0 -0
  117. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/expiration_cycle.py +0 -0
  118. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/instrument_status.py +0 -0
  119. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/option_type.py +0 -0
  120. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/subscribe_type.py +0 -0
  121. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/common/timespan.py +0 -0
  122. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/data_client.py +0 -0
  123. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/data_streaming_client.py +0 -0
  124. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/__init__.py +0 -0
  125. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/default_retry_policy.py +0 -0
  126. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/exceptions.py +0 -0
  127. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/quotes_client.py +0 -0
  128. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/quotes_decoder.py +0 -0
  129. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/quotes_payload_decoder.py +0 -0
  130. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/internal/quotes_topic.py +0 -0
  131. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/__init__.py +0 -0
  132. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/crypto_market_data.py +0 -0
  133. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/event_market_data.py +0 -0
  134. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/futures_market_data.py +0 -0
  135. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/instrument.py +0 -0
  136. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/market_data.py +0 -0
  137. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/market_streaming_data.py +0 -0
  138. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/__init__.py +0 -0
  139. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/ask_bid_result.py +0 -0
  140. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/basic_result.py +0 -0
  141. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/broker_result.py +0 -0
  142. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/event_depth_decoder.py +0 -0
  143. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/event_depth_result.py +0 -0
  144. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/event_snapshot_decoder.py +0 -0
  145. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/event_snapshot_result.py +0 -0
  146. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/event_tick_decoder.py +0 -0
  147. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/event_tick_result.py +0 -0
  148. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/message_pb2.py +0 -0
  149. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/order_result.py +0 -0
  150. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/payload_type.py +0 -0
  151. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/quote_decoder.py +0 -0
  152. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/quote_result.py +0 -0
  153. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/snapshot_decoder.py +0 -0
  154. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/snapshot_result.py +0 -0
  155. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/tick_decoder.py +0 -0
  156. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/quotes/subscribe/tick_result.py +0 -0
  157. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/__init__.py +0 -0
  158. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_batch_historical_bars_request.py +0 -0
  159. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_corp_action_request.py +0 -0
  160. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_crypto_historical_bars_request.py +0 -0
  161. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_crypto_instruments_request.py +0 -0
  162. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_crypto_snapshot_request.py +0 -0
  163. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_eod_bars_request.py +0 -0
  164. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_bars_request.py +0 -0
  165. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_depth_request.py +0 -0
  166. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_events_request.py +0 -0
  167. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_instrument_request.py +0 -0
  168. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_series_categories.py +0 -0
  169. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_series_request.py +0 -0
  170. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_snapshot_request.py +0 -0
  171. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_event_tick_request.py +0 -0
  172. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_footprint_request.py +0 -0
  173. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_depth_request.py +0 -0
  174. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_footprint_request.py +0 -0
  175. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_historical_bars_request.py +0 -0
  176. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_instruments_by_code_request.py +0 -0
  177. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_instruments_request.py +0 -0
  178. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_products_request.py +0 -0
  179. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_snapshot_request.py +0 -0
  180. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_futures_tick_request.py +0 -0
  181. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_historical_bars_request.py +0 -0
  182. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_instruments_request.py +0 -0
  183. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_quotes_request.py +0 -0
  184. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_snapshot_request.py +0 -0
  185. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/get_tick_request.py +0 -0
  186. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/subscribe_request.py +0 -0
  187. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/data/request/unsubscribe_request.py +0 -0
  188. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/__init__.py +0 -0
  189. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/account_type.py +0 -0
  190. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/combo_ticker_type.py +0 -0
  191. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/combo_type.py +0 -0
  192. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/currency.py +0 -0
  193. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/forbid_reason.py +0 -0
  194. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/instrument_type.py +0 -0
  195. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/markets.py +0 -0
  196. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/order_entrust_type.py +0 -0
  197. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/order_side.py +0 -0
  198. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/order_status.py +0 -0
  199. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/order_tif.py +0 -0
  200. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/order_type.py +0 -0
  201. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/position_intent.py +0 -0
  202. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/trade_policy.py +0 -0
  203. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/trading_date_type.py +0 -0
  204. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/common/trailing_type.py +0 -0
  205. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/events/__init__.py +0 -0
  206. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/events/default_retry_policy.py +0 -0
  207. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/events/events_pb2.py +0 -0
  208. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/events/events_pb2_grpc.py +0 -0
  209. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/events/types.py +0 -0
  210. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/__init__.py +0 -0
  211. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/cancel_order_request.py +0 -0
  212. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_account_balance_request.py +0 -0
  213. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_account_positions_request.py +0 -0
  214. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_account_profile_request.py +0 -0
  215. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_app_subscriptions.py +0 -0
  216. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_open_orders_request.py +0 -0
  217. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_order_detail_request.py +0 -0
  218. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_today_orders_request.py +0 -0
  219. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_trade_calendar_request.py +0 -0
  220. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_trade_instrument_detail_request.py +0 -0
  221. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_trade_security_detail_request.py +0 -0
  222. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/get_tradeable_instruments_request.py +0 -0
  223. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/palce_order_request.py +0 -0
  224. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/place_order_request.py +0 -0
  225. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/place_order_request_v2.py +0 -0
  226. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/replace_order_request.py +0 -0
  227. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/replace_order_request_v2.py +0 -0
  228. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/__init__.py +0 -0
  229. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/cancel_option_request.py +0 -0
  230. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/cancel_order_request.py +0 -0
  231. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_account_balance_request.py +0 -0
  232. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_account_list.py +0 -0
  233. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_account_list_request.py +0 -0
  234. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_account_positions_request.py +0 -0
  235. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_order_detail_request.py +0 -0
  236. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_order_history_request.py +0 -0
  237. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/get_order_open_request.py +0 -0
  238. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/palce_order_request.py +0 -0
  239. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/place_option_request.py +0 -0
  240. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/place_order_request.py +0 -0
  241. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/preview_option_request.py +0 -0
  242. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/preview_order_request.py +0 -0
  243. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/replace_option_request.py +0 -0
  244. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v2/replace_order_request.py +0 -0
  245. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/__init__.py +0 -0
  246. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/batch_place_order_request.py +0 -0
  247. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/cancel_order_request.py +0 -0
  248. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/get_order_detail_request.py +0 -0
  249. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/get_order_history_request.py +0 -0
  250. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/get_order_open_request.py +0 -0
  251. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/place_order_request.py +0 -0
  252. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/preview_order_request.py +0 -0
  253. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/request/v3/replace_order_request.py +0 -0
  254. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/__init__.py +0 -0
  255. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/account_info.py +0 -0
  256. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/order_operation.py +0 -0
  257. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/trade_calendar.py +0 -0
  258. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/trade_instrument.py +0 -0
  259. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/v2/__init__.py +0 -0
  260. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/v2/order_operation_v2.py +0 -0
  261. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade/v3/__init__.py +0 -0
  262. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull/trade/trade_client.py +0 -0
  263. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull_openapi_python_sdk.egg-info/dependency_links.txt +0 -0
  264. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull_openapi_python_sdk.egg-info/requires.txt +0 -0
  265. {webull_openapi_python_sdk-2.0.3 → webull_openapi_python_sdk-2.0.4}/webull_openapi_python_sdk.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webull-openapi-python-sdk
3
- Version: 2.0.3
3
+ Version: 2.0.4
4
4
  Summary: Webull Python SDK.
5
5
  Home-page:
6
6
  Author: Webull
@@ -0,0 +1 @@
1
+ __version__ = '2.0.4'
@@ -49,6 +49,12 @@ if __name__ == '__main__':
49
49
  if res.status_code == 200:
50
50
  print('get account position res:', res.json())
51
51
 
52
+ # Currently, only Webull JP is supported.
53
+ # instrument_id = None # Get the instrument_id from the position list.
54
+ # res = trade_client.account_v2.get_account_position_details(account_id, instrument_id)
55
+ # if res.status_code == 200:
56
+ # print('get account position details res:', res.json())
57
+
52
58
  # ============================================================
53
59
  # Equity Order Example
54
60
  # ============================================================
@@ -66,10 +72,13 @@ if __name__ == '__main__':
66
72
  "order_type": "LIMIT",
67
73
  "limit_price": "188",
68
74
  "quantity": "1",
69
- "support_trading_session": "N",
75
+ "support_trading_session": "CORE",
70
76
  "side": "BUY",
71
77
  "time_in_force": "DAY",
72
- "entrust_type": "QTY"
78
+ "entrust_type": "QTY",
79
+ # Currently, only Webull JP is supported.
80
+ # "account_tax_type":"GENERAL",
81
+ # "margin_type": "ONE_DAY"
73
82
  }
74
83
  ]
75
84
 
@@ -0,0 +1 @@
1
+ __version__ = '2.0.4'
@@ -1,4 +1,4 @@
1
- __version__ = '2.0.3'
1
+ __version__ = '2.0.4'
2
2
 
3
3
  import logging
4
4
 
@@ -0,0 +1,64 @@
1
+ # Copyright 2022 Webull
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Licensed to the Apache Software Foundation (ASF) under one
16
+ # or more contributor license agreements. See the NOTICE file
17
+ # distributed with this work for additional information
18
+ # regarding copyright ownership. The ASF licenses this file
19
+ # to you under the Apache License, Version 2.0 (the
20
+ # "License"); you may not use this file except in compliance
21
+ # with the License. You may obtain a copy of the License at
22
+ #
23
+ # http://www.apache.org/licenses/LICENSE-2.0
24
+ #
25
+ # Unless required by applicable law or agreed to in writing,
26
+ # software distributed under the License is distributed on an
27
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
28
+ # KIND, either express or implied. See the License for the
29
+ # specific language governing permissions and limitations
30
+ # under the License.
31
+
32
+ # coding=utf-8
33
+
34
+ """
35
+ This file borrowed some of its methods from a modified fork of the
36
+ https://github.com/aliyun/aliyun-openapi-python-sdk/blob/master/aliyun-python-sdk-core/aliyunsdkcore/auth/algorithm/sha_hmac256.py
37
+ which was part of Alibaba Group.
38
+ """
39
+ import hashlib
40
+ import hmac
41
+
42
+ from webull.core.compat import ensure_string
43
+ from webull.core.compat import ensure_bytes
44
+ from webull.core.compat import b64_encode_bytes
45
+
46
+
47
+ def get_sign_string(source, secret):
48
+ source = ensure_bytes(source)
49
+ secret = ensure_bytes(secret)
50
+ h = hmac.new(secret, source, hashlib.sha256)
51
+ signature = ensure_string(b64_encode_bytes(h.digest()).strip())
52
+ return signature
53
+
54
+
55
+ def get_signer_name():
56
+ return "HMAC-SHA256"
57
+
58
+
59
+ def get_signer_version():
60
+ return "1.0"
61
+
62
+
63
+ def get_signer_type():
64
+ return ""
@@ -38,6 +38,7 @@ which was part of Alibaba Group.
38
38
  """
39
39
 
40
40
  from webull.core.auth.algorithm import sha_hmac1
41
+ from webull.core.auth.algorithm import sha_hmac256_new
41
42
  from webull.core.exception import error_code
42
43
  from webull.core.exception.exceptions import ClientException
43
44
  from webull.core.utils import common
@@ -51,27 +52,36 @@ PARAM_KV_JOIN = "="
51
52
  PARAMS_JOIN = "&"
52
53
  SECRET_TAILER = "&"
53
54
 
54
- def _refresh_sign_headers(host, headers, app_key_id, signer_spec=sha_hmac1):
55
+ def _refresh_sign_headers(host, headers, app_key_id, signer_spec):
55
56
  if not host:
56
57
  raise ClientException(error_code.SDK_INVALID_PARAMETER)
57
58
  sign_headers = {}
58
59
  sign_headers[hd.APP_KEY] = app_key_id
59
60
  sign_headers[hd.TIMESTAMP] = common.get_iso_8601_date()
61
+
62
+ if common.is_not_upgrade_api_host(host):
63
+ signer_spec = sha_hmac256_new
64
+ else:
65
+ signer_spec = sha_hmac1
66
+
60
67
  sign_headers[hd.SIGN_VERSION] = signer_spec.get_signer_version()
61
68
  sign_headers[hd.SIGN_ALGORITHM] = signer_spec.get_signer_name()
62
69
  sign_headers[hd.NONCE] = common.get_uuid()
63
70
  headers.update(sign_headers)
64
71
  # DO NOT PUT Host Header in headers object, just put into sign_headers
65
72
  sign_headers[hd.NATIVE_HOST] = host
66
- return sign_headers
73
+ return sign_headers,signer_spec
67
74
 
68
- def _gen_signature(string_to_sign, secret, signer_spec=sha_hmac1):
75
+ def _gen_signature(string_to_sign, secret, signer_spec):
69
76
  return signer_spec.get_sign_string(string_to_sign, secret + SECRET_TAILER)
70
77
 
71
- def _get_body_string(body_params):
78
+ def _get_body_string(body_params, signer_spec):
72
79
  if body_params is not None:
73
80
  raw_str = common.json_dumps_compact(body_params)
74
- hex_digest = common.md5_hex(raw_str)
81
+ if signer_spec == sha_hmac256_new:
82
+ hex_digest = common.sha256_hex(raw_str)
83
+ else:
84
+ hex_digest = common.md5_hex(raw_str)
75
85
  return hex_digest.upper()
76
86
  else:
77
87
  return None
@@ -100,8 +110,8 @@ def _lower_key_dict(od):
100
110
  lower_key_dict[k.lower()] = v
101
111
  return lower_key_dict
102
112
 
103
- def calc_signature(headers, host, uri, queries, body_params, app_key_id, app_key_secret, signer_spec=sha_hmac1):
104
- sign_headers = _refresh_sign_headers(host, headers, app_key_id, signer_spec)
113
+ def calc_signature(headers, host, uri, queries, body_params, app_key_id, app_key_secret, signer_spec):
114
+ sign_headers,signer_spec = _refresh_sign_headers(host, headers, app_key_id, signer_spec)
105
115
  logger.debug("sign_headers:%s", sign_headers)
106
116
  sign_params = _lower_key_dict(sign_headers)
107
117
  logger.debug("sign_queries:%s", queries)
@@ -114,12 +124,11 @@ def calc_signature(headers, host, uri, queries, body_params, app_key_id, app_key
114
124
  cv = str(v)
115
125
  sign_params[k] = cv
116
126
  logger.debug("body:%s", body_params)
117
- body_string = _get_body_string(body_params)
127
+ body_string = _get_body_string(body_params, signer_spec)
118
128
  logger.debug("body_string:%s" % body_string)
119
129
  string_to_sign = _build_sign_string(sign_params, uri, body_string)
120
130
  logger.debug("string_to_sign:%s" % string_to_sign)
121
131
  signature = _gen_signature(string_to_sign, app_key_secret, signer_spec)
122
132
  headers[hd.SIGNATURE] = signature
123
133
  logger.debug("signature:%s", signature)
124
- return signature
125
-
134
+ return signature
@@ -58,5 +58,20 @@ def md5_hex(content):
58
58
  content_bytes = ensure_bytes(content)
59
59
  return hashlib.md5(content_bytes).hexdigest()
60
60
 
61
+ def sha256_hex(content):
62
+ content_bytes = ensure_bytes(content)
63
+ return hashlib.sha256(content_bytes).hexdigest()
64
+
61
65
  def json_dumps_compact(content):
62
- return json.dumps(content, ensure_ascii=False, separators=(',', ':'))
66
+ return json.dumps(content, ensure_ascii=False, separators=(',', ':'))
67
+
68
+ def is_not_upgrade_api_host(host):
69
+ upgrade_hosts = {
70
+ "api.webull.com","events-api.webull.com",
71
+ "api.webull.hk","events-api.webull.hk",
72
+ "pre-openapi-us-alb.webullbroker.com","pre-openapi-us-events.webullbroker.com",
73
+ "pre-openapi-alb.webullbroker.com","pre-openapi-events.webullbroker.com",
74
+ "us-openapi-alb.uat.webullbroker.com","us-openapi-events.uat.webullbroker.com",
75
+ "hk-openapi.uat.webullbroker.com", "hk-openapi-events-api.uat.webullbroker.com"
76
+ }
77
+ return host not in upgrade_hosts
@@ -0,0 +1,3 @@
1
+ # coding=utf-8
2
+
3
+ __version__ = '2.0.4'
@@ -26,3 +26,4 @@ class Category(EasyEnum):
26
26
  US_CRYPTO = (8, "US CRYPTO")
27
27
  US_FUTURES = (12, "US FUTURES")
28
28
  US_EVENT = (13, "US EVENT")
29
+ HK_FUTURES = (13, "HK FUTURES")
@@ -0,0 +1 @@
1
+ __version__ = '2.0.4'
@@ -26,3 +26,4 @@ class Category(EasyEnum):
26
26
  CN_STOCK = (7, "CN STOCK")
27
27
  US_CRYPTO = (8, "US CRYPTO")
28
28
  US_FUTURES = (12, "US FUTURES")
29
+ HK_FUTURES = (13, "HK FUTURES")
@@ -14,14 +14,14 @@
14
14
 
15
15
  # coding=utf-8
16
16
  from asyncio.log import logger
17
- from webull.core.auth.algorithm import sha_hmac1
17
+ from webull.core.auth.algorithm import sha_hmac1, sha_hmac256_new
18
18
  from webull.core.auth.composer import default_signature_composer
19
19
  import webull.core.headers as hd
20
20
  import webull.core.utils.common as core_common
21
21
  import logging
22
22
  logger = logging.getLogger(__name__)
23
23
 
24
- def _build_sign_metadata(app_key_id, signer_spec=sha_hmac1):
24
+ def _build_sign_metadata(app_key_id, signer_spec):
25
25
  sign_params = {}
26
26
  sign_algorithm = signer_spec.get_signer_name()
27
27
  sign_version = signer_spec.get_signer_version()
@@ -41,17 +41,21 @@ def _build_sign_metadata(app_key_id, signer_spec=sha_hmac1):
41
41
  sign_params[hd.TIMESTAMP] = ts
42
42
  return metadata, sign_params
43
43
 
44
- def _get_body_string(pb_object):
44
+ def _get_body_string(pb_object, signer_spec):
45
45
  if pb_object:
46
46
  pb_object_bytes = pb_object.SerializeToString()
47
- return core_common.md5_hex(pb_object_bytes)
47
+
48
+ if signer_spec == sha_hmac256_new:
49
+ return core_common.sha256_hex(pb_object_bytes)
50
+ else:
51
+ return core_common.md5_hex(pb_object_bytes)
48
52
  return None
49
53
 
50
- def calc_signature(app_key_id, app_key_secret, pb_object, signer_spec=sha_hmac1):
54
+ def calc_signature(app_key_id, app_key_secret, pb_object, signer_spec):
51
55
  metadata, sign_params = _build_sign_metadata(app_key_id, signer_spec)
52
56
  sign_params = default_signature_composer._lower_key_dict(sign_params)
53
57
  logger.debug("sign_params:%s", sign_params)
54
- body_string = _get_body_string(pb_object)
58
+ body_string = _get_body_string(pb_object,signer_spec)
55
59
  logger.debug("body_string:%s" % body_string)
56
60
  string_to_sign = default_signature_composer._build_sign_string(sign_params, None, body_string)
57
61
  logger.debug("string_to_sign:%s" % string_to_sign)
@@ -0,0 +1,35 @@
1
+ # Copyright 2022 Webull
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # coding=utf-8
16
+ from webull.core.request import ApiRequest
17
+
18
+
19
+ class AccountPositionDetailsRequest(ApiRequest):
20
+ def __init__(self):
21
+ ApiRequest.__init__(self, "/openapi/assets/position/details", version='v2', method="GET", query_params={})
22
+
23
+ def set_account_id(self, account_id):
24
+ self.add_query_param("account_id", account_id)
25
+
26
+ def set_instrument_id(self, instrument_id):
27
+ self.add_query_param("instrument_id", instrument_id)
28
+
29
+ def set_page_size(self, page_size):
30
+ if page_size:
31
+ self.add_query_param("page_size", page_size)
32
+
33
+ def set_last_id(self, last_id):
34
+ if last_id:
35
+ self.add_query_param("last_id", last_id)
@@ -15,6 +15,7 @@
15
15
 
16
16
  from webull.trade.request.v2.get_account_balance_request import AccountBalanceRequest
17
17
  from webull.trade.request.v2.get_account_list_request import GetAccountListRequest
18
+ from webull.trade.request.v2.get_account_position_details_request import AccountPositionDetailsRequest
18
19
  from webull.trade.request.v2.get_account_positions_request import AccountPositionsRequest
19
20
 
20
21
 
@@ -24,7 +25,7 @@ class AccountV2:
24
25
 
25
26
  def get_account_list(self):
26
27
  """
27
- This interface is currently supported only for Webull HK and Webull US.
28
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
28
29
  Support for other regions will be available in future updates.
29
30
  """
30
31
  account_list = GetAccountListRequest()
@@ -33,7 +34,7 @@ class AccountV2:
33
34
 
34
35
  def get_account_balance(self, account_id):
35
36
  """
36
- This interface is currently supported only for Webull HK and Webull US.
37
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
37
38
  Support for other regions will be available in future updates.
38
39
  """
39
40
  account_balance_request = AccountBalanceRequest()
@@ -43,10 +44,23 @@ class AccountV2:
43
44
 
44
45
  def get_account_position(self, account_id):
45
46
  """
46
- This interface is currently supported only for Webull HK and Webull US.
47
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
47
48
  Support for other regions will be available in future updates.
48
49
  """
49
50
  account_positions_request = AccountPositionsRequest()
50
51
  account_positions_request.set_account_id(account_id)
51
52
  response = self.client.get_response(account_positions_request)
52
53
  return response
54
+
55
+ def get_account_position_details(self, account_id, instrument_id, page_size=None, last_id=None):
56
+ """
57
+ This interface is currently supported only for Webull JP.
58
+ Support for other regions will be available in future updates.
59
+ """
60
+ account_position_details_request = AccountPositionDetailsRequest()
61
+ account_position_details_request.set_account_id(account_id)
62
+ account_position_details_request.set_instrument_id(instrument_id)
63
+ account_position_details_request.set_page_size(page_size)
64
+ account_position_details_request.set_last_id(last_id)
65
+ response = self.client.get_response(account_position_details_request)
66
+ return response
@@ -28,7 +28,7 @@ class OrderOperationV3:
28
28
 
29
29
  def preview_order(self, account_id, preview_orders, client_combo_order_id=None):
30
30
  """
31
- This interface is currently supported only for Webull US.
31
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
32
32
  Support for other regions will be available in future updates.
33
33
  """
34
34
  preview_order_request = PreviewOrderRequest()
@@ -40,7 +40,7 @@ class OrderOperationV3:
40
40
 
41
41
  def place_order(self, account_id, new_orders, client_combo_order_id=None):
42
42
  """
43
- This interface is currently supported only for Webull US.
43
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
44
44
  Support for other regions will be available in future updates.
45
45
  """
46
46
  place_order_request = PlaceOrderRequest()
@@ -65,7 +65,7 @@ class OrderOperationV3:
65
65
 
66
66
  def replace_order(self, account_id, modify_orders, client_combo_order_id=None):
67
67
  """
68
- This interface is currently supported only for Webull US.
68
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
69
69
  Support for other regions will be available in future updates.
70
70
  """
71
71
  replace_order_request = ReplaceOrderRequest()
@@ -77,7 +77,7 @@ class OrderOperationV3:
77
77
 
78
78
  def cancel_order(self, account_id, client_order_id):
79
79
  """
80
- This interface is currently supported only for Webull US.
80
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
81
81
  Support for other regions will be available in future updates.
82
82
  """
83
83
  cancel_order_request = CancelOrderRequest()
@@ -88,7 +88,7 @@ class OrderOperationV3:
88
88
 
89
89
  def get_order_detail(self, account_id, client_order_id):
90
90
  """
91
- This interface is currently supported only for Webull US.
91
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
92
92
  Support for other regions will be available in future updates.
93
93
  """
94
94
  order_detail_request = OrderDetailRequest()
@@ -99,7 +99,7 @@ class OrderOperationV3:
99
99
 
100
100
  def get_order_history(self, account_id, page_size=None, start_date=None, end_date=None, last_client_order_id=None):
101
101
  """
102
- This interface is currently supported only for Webull US.
102
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
103
103
  Support for other regions will be available in future updates.
104
104
 
105
105
  Historical orders. If they are group orders, will be returned together,
@@ -127,7 +127,7 @@ class OrderOperationV3:
127
127
 
128
128
  def get_order_open(self, account_id, page_size=None, last_client_order_id=None):
129
129
  """
130
- This interface is currently supported only for Webull US.
130
+ This interface is currently supported only for Webull HK, Webull US, and Webull JP.
131
131
  Support for other regions will be available in future updates.
132
132
 
133
133
  Paging query pending orders.
@@ -19,7 +19,10 @@ import threading
19
19
  import time
20
20
 
21
21
  import grpc
22
+
23
+ from webull.core.auth.algorithm import sha_hmac256_new, sha_hmac1
22
24
  from webull.core.common import api_type
25
+ from webull.core.utils import common
23
26
  from webull.core.endpoint.default_endpoint_resolver import \
24
27
  DefaultEndpointResolver
25
28
  from webull.core.endpoint.resolver_endpoint_request import \
@@ -77,7 +80,21 @@ class TradeEventsClient():
77
80
  timestamp=int(time.time() * 1000), # millis
78
81
  accounts=accounts,
79
82
  )
80
- signature, metadata = calc_signature(app_key, app_secret, request)
83
+ if common.is_not_upgrade_api_host(self._host):
84
+ signer_spec = sha_hmac256_new
85
+ else:
86
+ signer_spec = sha_hmac1
87
+
88
+ signature, metadata = calc_signature(app_key, app_secret, request, signer_spec)
89
+
90
+ # Print detailed request parameters
91
+ print("\n=== gRPC Request Details ===")
92
+ print(f"Request: {request}")
93
+ print(f"Signature: {signature}")
94
+ print(f"Metadata: {metadata}")
95
+ print(f"Signer Spec: {signer_spec.__name__ if hasattr(signer_spec, '__name__') else signer_spec}")
96
+ print("=============================\n")
97
+
81
98
  return request, metadata
82
99
 
83
100
  def _stream_processing(self, stub, accounts):
@@ -226,6 +243,14 @@ class TradeEventsClient():
226
243
 
227
244
  def do_subscribe(self, accounts):
228
245
  target = self._host + ":" + str(self._port)
246
+ # Print gRPC connection parameters
247
+ print("\n=== gRPC Connection Parameters ===")
248
+ print(f"Host: {self._host}")
249
+ print(f"Port: {self._port}")
250
+ print(f"Target: {target}")
251
+ print(f"TLS Enabled: {self._tls_enable}")
252
+ print("==================================\n")
253
+
229
254
  if self._tls_enable:
230
255
  ssl_channel_credentials = grpc.ssl_channel_credentials()
231
256
  with grpc.secure_channel(target, ssl_channel_credentials) as channel:
@@ -234,4 +259,4 @@ class TradeEventsClient():
234
259
  else:
235
260
  with grpc.insecure_channel(target) as channel:
236
261
  stub = pb_grpc.EventServiceStub(channel)
237
- self._stream_processing(stub, accounts)
262
+ self._stream_processing(stub, accounts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webull-openapi-python-sdk
3
- Version: 2.0.3
3
+ Version: 2.0.4
4
4
  Summary: Webull Python SDK.
5
5
  Home-page:
6
6
  Author: Webull
@@ -36,6 +36,7 @@ webull/core/auth/credentials.py
36
36
  webull/core/auth/algorithm/__init__.py
37
37
  webull/core/auth/algorithm/sha_hmac1.py
38
38
  webull/core/auth/algorithm/sha_hmac256.py
39
+ webull/core/auth/algorithm/sha_hmac256_new.py
39
40
  webull/core/auth/composer/__init__.py
40
41
  webull/core/auth/composer/default_signature_composer.py
41
42
  webull/core/auth/signers/__init__.py
@@ -221,6 +222,7 @@ webull/trade/request/v2/cancel_order_request.py
221
222
  webull/trade/request/v2/get_account_balance_request.py
222
223
  webull/trade/request/v2/get_account_list.py
223
224
  webull/trade/request/v2/get_account_list_request.py
225
+ webull/trade/request/v2/get_account_position_details_request.py
224
226
  webull/trade/request/v2/get_account_positions_request.py
225
227
  webull/trade/request/v2/get_order_detail_request.py
226
228
  webull/trade/request/v2/get_order_history_request.py
@@ -1 +0,0 @@
1
- __version__ = '2.0.3'
@@ -1 +0,0 @@
1
- __version__ = '2.0.3'
@@ -1,3 +0,0 @@
1
- # coding=utf-8
2
-
3
- __version__ = '2.0.3'
@@ -1 +0,0 @@
1
- __version__ = '2.0.3'