binance-sdk-spot 1.0.0__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 (302) hide show
  1. binance_sdk_spot-1.0.0/CHANGELOG.md +5 -0
  2. binance_sdk_spot-1.0.0/LICENCE +0 -0
  3. binance_sdk_spot-1.0.0/PKG-INFO +497 -0
  4. binance_sdk_spot-1.0.0/README.md +469 -0
  5. binance_sdk_spot-1.0.0/pyproject.toml +40 -0
  6. binance_sdk_spot-1.0.0/src/binance_sdk_spot/__init__.py +43 -0
  7. binance_sdk_spot-1.0.0/src/binance_sdk_spot/metadata.py +1 -0
  8. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/__init__.py +18 -0
  9. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/api/__init__.py +20 -0
  10. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/api/account_api.py +711 -0
  11. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/api/general_api.py +156 -0
  12. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/api/market_api.py +700 -0
  13. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/api/trade_api.py +1371 -0
  14. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/api/user_data_stream_api.py +151 -0
  15. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/__init__.py +332 -0
  16. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/account_commission_response.py +160 -0
  17. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/account_commission_response_discount.py +126 -0
  18. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/account_commission_response_standard_commission.py +117 -0
  19. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/account_commission_response_tax_commission.py +117 -0
  20. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/agg_trades_response.py +86 -0
  21. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/agg_trades_response_inner.py +125 -0
  22. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/all_order_list_response.py +86 -0
  23. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/all_order_list_response_inner.py +155 -0
  24. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/all_order_list_response_inner_orders_inner.py +115 -0
  25. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/all_orders_response.py +86 -0
  26. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/all_orders_response_inner.py +176 -0
  27. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/avg_price_response.py +115 -0
  28. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/delete_open_orders_response.py +86 -0
  29. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/delete_open_orders_response_inner.py +166 -0
  30. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/delete_order_list_response.py +177 -0
  31. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/delete_order_list_response_order_reports_inner.py +169 -0
  32. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/delete_order_list_response_orders_inner.py +115 -0
  33. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/delete_order_response.py +166 -0
  34. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/depth_response.py +115 -0
  35. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/enums.py +502 -0
  36. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/exchange_filters.py +218 -0
  37. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/exchange_info_response.py +171 -0
  38. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/exchange_info_response_symbols_inner.py +222 -0
  39. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_account_response.py +191 -0
  40. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_account_response_balances_inner.py +115 -0
  41. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_account_response_commission_rates.py +117 -0
  42. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_open_orders_response.py +86 -0
  43. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_order_list_response.py +155 -0
  44. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_order_list_response_orders_inner.py +115 -0
  45. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_order_response.py +176 -0
  46. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/get_trades_response.py +86 -0
  47. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/historical_trades_response.py +86 -0
  48. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/historical_trades_response_inner.py +131 -0
  49. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/klines_item.py +84 -0
  50. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/klines_item_inner.py +137 -0
  51. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/klines_response.py +84 -0
  52. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/my_allocations_response.py +86 -0
  53. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/my_allocations_response_inner.py +152 -0
  54. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/my_prevented_matches_response.py +86 -0
  55. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/my_prevented_matches_response_inner.py +146 -0
  56. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/my_trades_response.py +86 -0
  57. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/my_trades_response_inner.py +149 -0
  58. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/new_order_response.py +184 -0
  59. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/new_order_response_fills_inner.py +125 -0
  60. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/new_user_data_stream_response.py +107 -0
  61. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/open_order_list_response.py +86 -0
  62. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/open_order_list_response_inner.py +155 -0
  63. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/open_order_list_response_inner_orders_inner.py +115 -0
  64. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_amend_keep_priority_response.py +150 -0
  65. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_amend_keep_priority_response_amended_order.py +167 -0
  66. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_amend_keep_priority_response_list_status.py +151 -0
  67. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_amend_keep_priority_response_list_status_orders_inner.py +115 -0
  68. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_amendments_response.py +86 -0
  69. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_amendments_response_inner.py +138 -0
  70. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_cancel_replace_response.py +169 -0
  71. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_cancel_replace_response_cancel_response.py +166 -0
  72. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_cancel_replace_response_data.py +150 -0
  73. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_cancel_replace_response_data_cancel_response.py +172 -0
  74. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_cancel_replace_response_data_new_order_response.py +131 -0
  75. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_cancel_replace_response_new_order_response.py +167 -0
  76. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_oco_response.py +177 -0
  77. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_oco_response_order_reports_inner.py +170 -0
  78. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_oco_response_orders_inner.py +115 -0
  79. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_oto_response.py +177 -0
  80. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_oto_response_order_reports_inner.py +164 -0
  81. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_oto_response_orders_inner.py +115 -0
  82. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_otoco_response.py +177 -0
  83. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_otoco_response_order_reports_inner.py +167 -0
  84. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_list_otoco_response_orders_inner.py +115 -0
  85. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_oco_response.py +177 -0
  86. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_oco_response_order_reports_inner.py +167 -0
  87. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_oco_response_orders_inner.py +115 -0
  88. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_test_response.py +156 -0
  89. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_test_response_discount.py +126 -0
  90. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/order_test_response_standard_commission_for_order.py +110 -0
  91. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/rate_limit_order_response.py +86 -0
  92. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/rate_limit_order_response_inner.py +125 -0
  93. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/rate_limits.py +125 -0
  94. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/sor_order_response.py +190 -0
  95. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/sor_order_response_fills_inner.py +131 -0
  96. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/sor_order_test_response.py +156 -0
  97. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker24hr_response.py +141 -0
  98. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker24hr_response1.py +177 -0
  99. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker24hr_response2.py +86 -0
  100. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker24hr_response2_inner.py +177 -0
  101. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_book_ticker_response.py +153 -0
  102. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_book_ticker_response1.py +125 -0
  103. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_book_ticker_response2.py +86 -0
  104. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_book_ticker_response2_inner.py +125 -0
  105. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_price_response.py +141 -0
  106. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_price_response1.py +110 -0
  107. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_price_response2.py +86 -0
  108. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_price_response2_inner.py +110 -0
  109. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_response.py +139 -0
  110. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_response1.py +159 -0
  111. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_response2.py +84 -0
  112. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_response2_inner.py +159 -0
  113. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_trading_day_response.py +153 -0
  114. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_trading_day_response1.py +159 -0
  115. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_trading_day_response2.py +86 -0
  116. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ticker_trading_day_response2_inner.py +159 -0
  117. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/time_response.py +107 -0
  118. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ui_klines_item.py +84 -0
  119. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/models/ui_klines_response.py +84 -0
  120. binance_sdk_spot-1.0.0/src/binance_sdk_spot/rest_api/rest_api.py +2092 -0
  121. binance_sdk_spot-1.0.0/src/binance_sdk_spot/spot.py +86 -0
  122. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/__init__.py +18 -0
  123. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/__init__.py +21 -0
  124. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/account_api.py +772 -0
  125. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/auth_api.py +159 -0
  126. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/general_api.py +166 -0
  127. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/market_api.py +736 -0
  128. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/trade_api.py +1771 -0
  129. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/api/user_data_stream_api.py +244 -0
  130. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/__init__.py +459 -0
  131. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_commission_response.py +142 -0
  132. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_commission_response_result.py +160 -0
  133. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_commission_response_result_discount.py +126 -0
  134. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_commission_response_result_standard_commission.py +117 -0
  135. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_commission_response_result_tax_commission.py +117 -0
  136. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_rate_limits_orders_response.py +152 -0
  137. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_rate_limits_orders_response_result_inner.py +125 -0
  138. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_status_response.py +142 -0
  139. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_status_response_result.py +197 -0
  140. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_status_response_result_balances_inner.py +115 -0
  141. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/account_status_response_result_commission_rates.py +117 -0
  142. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/all_order_lists_response.py +152 -0
  143. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/all_order_lists_response_result_inner.py +158 -0
  144. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/all_orders_response.py +152 -0
  145. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/all_orders_response_result_inner.py +186 -0
  146. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/avg_price_response.py +142 -0
  147. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/avg_price_response_result.py +115 -0
  148. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/balance_update.py +112 -0
  149. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/depth_response.py +142 -0
  150. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/depth_response_result.py +117 -0
  151. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/enums.py +502 -0
  152. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/event_stream_terminated.py +107 -0
  153. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/exchange_filters_inner.py +218 -0
  154. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/exchange_info_response.py +142 -0
  155. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/exchange_info_response_result.py +203 -0
  156. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/exchange_info_response_result_sors_inner.py +111 -0
  157. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/exchange_info_response_result_symbols_inner.py +229 -0
  158. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/execution_report.py +260 -0
  159. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/external_lock_update.py +112 -0
  160. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/klines_item_inner.py +137 -0
  161. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/klines_response.py +157 -0
  162. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/list_status.py +153 -0
  163. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/list_status_o_inner.py +111 -0
  164. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/listen_key_expired.py +110 -0
  165. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/my_allocations_response.py +152 -0
  166. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/my_allocations_response_result_inner.py +152 -0
  167. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/my_prevented_matches_response.py +152 -0
  168. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/my_prevented_matches_response_result_inner.py +146 -0
  169. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/my_trades_response.py +152 -0
  170. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/my_trades_response_result_inner.py +149 -0
  171. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_order_lists_status_response.py +152 -0
  172. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_order_lists_status_response_result_inner.py +160 -0
  173. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_order_lists_status_response_result_inner_orders_inner.py +115 -0
  174. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_orders_cancel_all_response.py +152 -0
  175. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_orders_cancel_all_response_result_inner.py +253 -0
  176. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_orders_cancel_all_response_result_inner_order_reports_inner.py +169 -0
  177. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_orders_cancel_all_response_result_inner_orders_inner.py +115 -0
  178. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_orders_status_response.py +152 -0
  179. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/open_orders_status_response_result_inner.py +176 -0
  180. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amend_keep_priority_response.py +142 -0
  181. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amend_keep_priority_response_result.py +150 -0
  182. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amend_keep_priority_response_result_amended_order.py +167 -0
  183. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amend_keep_priority_response_result_list_status.py +154 -0
  184. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amend_keep_priority_response_result_list_status_orders_inner.py +115 -0
  185. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amendments_response.py +152 -0
  186. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_amendments_response_result_inner.py +138 -0
  187. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_cancel_replace_response.py +142 -0
  188. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_cancel_replace_response_result.py +150 -0
  189. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_cancel_replace_response_result_cancel_response.py +166 -0
  190. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_cancel_replace_response_result_new_order_response.py +161 -0
  191. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_cancel_response.py +142 -0
  192. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_cancel_response_result.py +250 -0
  193. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_cancel_response.py +142 -0
  194. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_cancel_response_result.py +181 -0
  195. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_cancel_response_result_order_reports_inner.py +164 -0
  196. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_cancel_response_result_orders_inner.py +115 -0
  197. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oco_response.py +142 -0
  198. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oco_response_result.py +183 -0
  199. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oco_response_result_order_reports_inner.py +167 -0
  200. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oco_response_result_orders_inner.py +115 -0
  201. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oto_response.py +142 -0
  202. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oto_response_result.py +183 -0
  203. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oto_response_result_order_reports_inner.py +164 -0
  204. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_oto_response_result_orders_inner.py +115 -0
  205. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_otoco_response.py +142 -0
  206. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_otoco_response_result.py +183 -0
  207. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_otoco_response_result_order_reports_inner.py +167 -0
  208. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_otoco_response_result_orders_inner.py +115 -0
  209. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_response.py +142 -0
  210. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_response_result.py +181 -0
  211. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_place_response_result_order_reports_inner.py +167 -0
  212. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_list_status_response.py +142 -0
  213. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_place_response.py +142 -0
  214. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_place_response_result.py +187 -0
  215. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_place_response_result_fills_inner.py +125 -0
  216. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_status_response.py +142 -0
  217. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_status_response_result.py +198 -0
  218. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_test_response.py +142 -0
  219. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_test_response_result.py +156 -0
  220. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_test_response_result_discount.py +126 -0
  221. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/order_test_response_result_standard_commission_for_order.py +110 -0
  222. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/outbound_account_position.py +133 -0
  223. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/outbound_account_position_b_inner.py +111 -0
  224. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ping_response.py +132 -0
  225. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/rate_limits_inner.py +125 -0
  226. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/session_logon_response.py +125 -0
  227. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/session_logon_response_result.py +130 -0
  228. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/session_logout_response.py +125 -0
  229. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/session_logout_response_result.py +130 -0
  230. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/session_status_response.py +125 -0
  231. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/session_status_response_result.py +130 -0
  232. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/sor_order_place_response.py +152 -0
  233. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/sor_order_place_response_result_inner.py +193 -0
  234. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/sor_order_place_response_result_inner_fills_inner.py +131 -0
  235. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/sor_order_test_response.py +142 -0
  236. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker24hr_response.py +143 -0
  237. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker24hr_response1.py +142 -0
  238. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker24hr_response1_result.py +177 -0
  239. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker24hr_response2.py +152 -0
  240. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker24hr_response2_result_inner.py +177 -0
  241. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_book_response.py +143 -0
  242. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_book_response1.py +142 -0
  243. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_book_response1_result.py +125 -0
  244. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_book_response2.py +152 -0
  245. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_book_response2_result_inner.py +125 -0
  246. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_price_response.py +143 -0
  247. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_price_response1.py +142 -0
  248. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_price_response1_result.py +110 -0
  249. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_price_response2.py +152 -0
  250. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_price_response2_result_inner.py +110 -0
  251. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_response.py +139 -0
  252. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_response1.py +142 -0
  253. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_response1_result.py +159 -0
  254. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_response2.py +152 -0
  255. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_response2_result_inner.py +159 -0
  256. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_trading_day_response.py +152 -0
  257. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ticker_trading_day_response_result_inner.py +159 -0
  258. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/time_response.py +142 -0
  259. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/time_response_result.py +107 -0
  260. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/trades_aggregate_response.py +152 -0
  261. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/trades_aggregate_response_result_inner.py +125 -0
  262. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/trades_historical_response.py +152 -0
  263. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/trades_historical_response_result_inner.py +131 -0
  264. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/trades_recent_response.py +152 -0
  265. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/trades_recent_response_result_inner.py +131 -0
  266. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/ui_klines_response.py +157 -0
  267. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_events_response.py +234 -0
  268. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_ping_response.py +132 -0
  269. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_start_response.py +142 -0
  270. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_start_response_result.py +107 -0
  271. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_stop_response.py +132 -0
  272. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_subscribe_response.py +115 -0
  273. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/models/user_data_stream_unsubscribe_response.py +115 -0
  274. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_api/websocket_api.py +2352 -0
  275. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/__init__.py +18 -0
  276. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/__init__.py +58 -0
  277. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/agg_trade_response.py +139 -0
  278. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/all_market_rolling_window_ticker_response.py +89 -0
  279. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/all_market_rolling_window_ticker_response_inner.py +157 -0
  280. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/all_mini_ticker_response.py +89 -0
  281. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/all_mini_ticker_response_inner.py +123 -0
  282. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/all_ticker_response.py +89 -0
  283. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/all_ticker_response_inner.py +175 -0
  284. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/avg_price_response.py +117 -0
  285. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/book_ticker_response.py +117 -0
  286. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/diff_book_depth_response.py +119 -0
  287. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/enums.py +72 -0
  288. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/exchange_filters.py +89 -0
  289. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/exchange_filters_inner.py +214 -0
  290. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/kline_offset_response.py +121 -0
  291. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/kline_response.py +121 -0
  292. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/kline_response_k.py +157 -0
  293. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/mini_ticker_response.py +123 -0
  294. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/partial_book_depth_response.py +111 -0
  295. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/rate_limits.py +87 -0
  296. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/rate_limits_inner.py +121 -0
  297. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/rolling_window_ticker_response.py +157 -0
  298. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/ticker_response.py +175 -0
  299. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/models/trade_response.py +123 -0
  300. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/streams/__init__.py +16 -0
  301. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/streams/web_socket_streams_api.py +651 -0
  302. binance_sdk_spot-1.0.0/src/binance_sdk_spot/websocket_streams/websocket_streams.py +471 -0
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 - 2025-07-17
4
+
5
+ - Initial release
File without changes
@@ -0,0 +1,497 @@
1
+ Metadata-Version: 2.1
2
+ Name: binance-sdk-spot
3
+ Version: 1.0.0
4
+ Summary: Official Binance Spot SDK - A lightweight library that provides a convenient interface to Binance's Spot REST API, WebSocket API and WebSocket Streams.
5
+ License: MIT
6
+ Author: Binance
7
+ Requires-Python: >=3.9,<=3.13
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Provides-Extra: dev
16
+ Requires-Dist: aiohttp (>=3.9,<4.0)
17
+ Requires-Dist: binance-common (==1.0.0)
18
+ Requires-Dist: black (>=25.1.0,<26.0.0)
19
+ Requires-Dist: pycryptodome (>=3.17,<4.0)
20
+ Requires-Dist: pydantic (>=2.10.0)
21
+ Requires-Dist: pytest (>=6.2.5) ; extra == "dev"
22
+ Requires-Dist: requests (>=2.31.0)
23
+ Requires-Dist: ruff (>=0.12.0,<0.13.0)
24
+ Requires-Dist: websocket-client (>=1.6.3)
25
+ Requires-Dist: websockets (>=15.0.1,<16.0.0)
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Binance Python SPOT SDK
29
+
30
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/binance/binance-connector-python/ci-spot.yml)](https://github.com/binance/binance-connector-python/actions)
31
+ [![Open Issues](https://img.shields.io/github/issues/binance/binance-connector-python)](https://github.com/binance/binance-connector-python/issues)
32
+ [![Code Style: Black](https://img.shields.io/badge/code_style-black-black)](https://black.readthedocs.io/en/stable/)
33
+ [![PyPI version](https://img.shields.io/pypi/v/binance-sdk-spot)](https://pypi.python.org/pypi/binance-sdk-spot)
34
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/binance-sdk-spot.svg)](https://pypi.org/project/binance-sdk-spot/)
35
+ [![Python version](https://img.shields.io/pypi/pyversions/binance-connector)](https://www.python.org/downloads/)
36
+ [![Known Vulnerabilities](https://img.shields.io/badge/security-scanned-brightgreen)](https://github.com/binance/binance-connector-python/security)
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
38
+
39
+ This is a client library for the Binance Spot SDK API, enabling developers to interact programmatically with Binance's SPOT trading platform. The library provides tools for retrieving market data, executing trades, and managing orders through three distinct endpoints:
40
+
41
+ - [REST API](./src/binance_sdk_spot/rest_api/rest_api.py)
42
+ - [Websocket API](./src/binance_sdk_spot/websocket_api/websocket_api.py)
43
+ - [Websocket Stream](./src/binance_sdk_spot/websocket_streams/websocket_streams.py)
44
+
45
+ ## Table of Contents
46
+
47
+ - [Supported Features](#supported-features)
48
+ - [Installation](#installation)
49
+ - [Documentation](#documentation)
50
+ - [REST APIs](#rest-apis)
51
+ - [Websocket APIs](#websocket-apis)
52
+ - [Websocket Streams](#websocket-streams)
53
+ - [Testing](#testing)
54
+ - [Migration Guide](#migration-guide)
55
+ - [Contributing](#contributing)
56
+ - [Licence](#licence)
57
+
58
+ ## Supported Features
59
+
60
+ - REST API Endpoints:
61
+ - `/api/*`
62
+ - WebSocket Endpoints: Real-time data streaming and request-response communication.
63
+ - Inclusion of test cases and examples for quick onboarding.
64
+
65
+ ## Installation
66
+
67
+ To use this library, ensure your environment is running Python version **3.9** or later.
68
+
69
+ ```bash
70
+ pip install binance-sdk-spot
71
+ ```
72
+
73
+ ## Documentation
74
+
75
+ For detailed information, refer to the [Binance API Documentation](https://developers.binance.com/docs/binance-sdk-spot-api-docs).
76
+
77
+ ### REST APIs
78
+
79
+ All REST API endpoints are available through the [`rest_api`](./src/binance_sdk_spot/rest_api/rest_api.py) module. The REST API enables you to fetch market data, manage trades, and access account information. Note that some endpoints require authentication using your Binance API credentials.
80
+
81
+ ```python
82
+ from binance_common.configuration import ConfigurationRestAPI
83
+ from binance_common.constants import SPOT_REST_API_PROD_URL
84
+ from binance_sdk_spot.spot import Spot
85
+ from binance_sdk_spot.rest_api.models import ExchangeInfoResponse, RateLimits
86
+
87
+ logging.basicConfig(level=logging.INFO)
88
+ configuration = ConfigurationRestAPI(api_key="your-api-key", api_secret="your-api-secret", base_path=SPOT_REST_API_PROD_URL)
89
+
90
+ client = Spot(config_rest_api=configuration)
91
+
92
+ try:
93
+ response = client.rest_api.exchange_info(symbol="BNBUSDT")
94
+
95
+ rate_limits: List[RateLimits] = response.rate_limits
96
+ logging.info(f"exchange_info() rate limits: {rate_limits}")
97
+
98
+ data: ExchangeInfoResponse = response.data()
99
+ logging.info(f"exchange_info() response: {data}")
100
+ except Exception as e:
101
+ logging.error(f"exchange_info() error: {e}")
102
+ ```
103
+
104
+ More examples can be found in the [`examples/rest_api`](./examples/rest_api/) folder.
105
+
106
+ #### Configuration Options
107
+
108
+ The REST API supports the following advanced configuration options:
109
+
110
+ - `timeout`: Timeout for requests in milliseconds (default: 1000 ms).
111
+ - `proxy`: Proxy configuration:
112
+ - `host`: Proxy server hostname.
113
+ - `port`: Proxy server port.
114
+ - `protocol`: Proxy protocol (http or https).
115
+ - `auth`: Proxy authentication credentials:
116
+ - `username`: Proxy username.
117
+ - `password`: Proxy password.
118
+ - `keep_alive`: Enable HTTP keep-alive (default: true).
119
+ - `compression`: Enable response compression (default: true).
120
+ - `retries`: Number of retry attempts for failed requests (default: 3).
121
+ - `backoff`: Delay in milliseconds between retries (default: 1000 ms).
122
+ - `https_agent`: Custom HTTPS agent for advanced TLS configuration.
123
+ - `time_unit`: Specify the time unit for timestamps (e.g., milliseconds or microseconds).
124
+ - `private_key`: RSA or ED25519 private key for authentication.
125
+ - `private_key_passphrase`: Passphrase for the private key, if encrypted.
126
+
127
+ ##### Timeout
128
+
129
+ You can configure a timeout for requests in milliseconds. If the request exceeds the specified timeout, it will be aborted. See the [Timeout example](./docs/rest_api/timeout.md) for detailed usage.
130
+
131
+ ##### Proxy
132
+
133
+ The REST API supports HTTP/HTTPS proxy configurations. See the [Proxy example](./docs/rest_api/proxy.md) for detailed usage.
134
+
135
+ ##### Keep-Alive
136
+
137
+ Enable HTTP keep-alive for persistent connections. See the [Keep-Alive example](./docs/rest_api/keepAlive.md) for detailed usage.
138
+
139
+ ##### Compression
140
+
141
+ Enable or disable response compression. See the [Compression example](./docs/rest_api/compression.md) for detailed usage.
142
+
143
+ ##### Retries
144
+
145
+ Configure the number of retry attempts and delay in milliseconds between retries for failed requests. See the [Retries example](./docs/rest_api/retries.md) for detailed usage.
146
+
147
+ ##### HTTPS Agent
148
+
149
+ Customize the HTTPS agent for advanced TLS configurations. See the [HTTPS Agent example](./docs/rest_api/httpsAgent.md) for detailed usage.
150
+
151
+ ##### Key Pair Based Authentication
152
+
153
+ The REST API supports key pair-based authentication for secure communication. You can use `RSA` or `ED25519` keys for signing requests. See the [Key Pair Based Authentication example](./docs/rest_api/key-pair-authentication.md) for detailed usage.
154
+
155
+ ##### Time Unit
156
+
157
+ The REST API supports different time units for timestamp values. See the [Time Unit example](./docs/rest_api/time-unit.md) for more details.
158
+
159
+ ##### Certificate Pinning
160
+
161
+ To enhance security, you can use certificate pinning with the `https_agent` option in the configuration. This ensures the client only communicates with servers using specific certificates. See the [Certificate Pinning example](./docs/rest_api/certificate-pinning.md) for detailed usage.
162
+
163
+ #### Error Handling
164
+
165
+ The REST API provides detailed error types to help you handle issues effectively:
166
+
167
+ - `ClientError`: Represents an error that occurred in the SDK client.
168
+ - `RequiredError`: Thrown when a required parameter is missing or undefined.
169
+ - `UnauthorizedError`: Indicates missing or invalid authentication credentials.
170
+ - `ForbiddenError`: Access to the requested resource is forbidden.
171
+ - `TooManyRequestsError`: Rate limit exceeded.
172
+ - `RateLimitBanError`: IP address banned for exceeding rate limits.
173
+ - `ServerError`: Internal server error, optionally includes a status code.
174
+ - `NetworkError`: Issues with network connectivity.
175
+ - `NotFoundError`: Resource not found.
176
+ - `BadRequestError`: Invalid request or one that cannot be served.
177
+
178
+ See the [Error Handling example](./docs/rest_api/error-handling.md) for detailed usage.
179
+
180
+ #### Testnet
181
+
182
+ For testing purposes, `/api/*` endpoints can be used in the [Spot Testnet](https://testnet.binance.vision/). Update the `base_path` in your configuration:
183
+
184
+ ```python
185
+ from binance_common.configuration import ConfigurationRestAPI
186
+ from binance_common.constants import SPOT_REST_API_TESTNET_URL
187
+ from binance_sdk_spot.spot import Spot
188
+
189
+ configuration = ConfigurationRestAPI(api_key="your-api-key", api_secret="your-api-secret", base_path=SPOT_REST_API_TESTNET_URL)
190
+ client = Spot(config_rest_api=configuration)
191
+ ```
192
+
193
+ If `base_path` is not provided, it defaults to `https://api.binance.com`.
194
+
195
+ ### Websocket APIs
196
+
197
+ The WebSocket API provides request-response communication for market data and trading actions. Use the [`websocket_api`](./src/binance_sdk_spot/websocket_api/websocket_api.py) module to interact with these endpoints.
198
+
199
+ ```python
200
+ import asyncio
201
+ import logging
202
+
203
+ from binance_common.configuration import ConfigurationWebSocketAPI
204
+ from binance_common.constants import SPOT_WS_API_PROD_URL
205
+ from binance_sdk_spot.spot import Spot
206
+ from binance_sdk_spot.websocket_api.models import AccountCommissionResponse
207
+
208
+ logging.basicConfig(level=logging.INFO)
209
+
210
+ configuration_ws_api = ConfigurationWebSocketAPI(api_key="your-api-key", api_secret="your-api-secret", stream_url=SPOT_WS_API_PROD_URL)
211
+ client = Spot(config_ws_api=configuration_ws_api)
212
+
213
+ async def exchange_info():
214
+ connection = None
215
+ try:
216
+ connection = await client.websocket_api.create_connection()
217
+
218
+ response = await connection.account_commission(
219
+ symbol="BNBUSDT",
220
+ )
221
+ result: AccountCommissionResponse = response.data()
222
+ print(f"Exchange Info: {result}")
223
+
224
+ except Exception as e:
225
+ print(f"exchange_info() error: {e}")
226
+ finally:
227
+ if connection:
228
+ await connection.close_connection(close_session=True)
229
+
230
+ if __name__ == "__main__":
231
+ asyncio.run(exchange_info())
232
+ ```
233
+
234
+ More examples are available in the [`examples/websocket_api`](./examples/websocket_api/) folder.
235
+
236
+ #### Configuration Options
237
+
238
+ The WebSocket API supports the following advanced configuration options:
239
+
240
+ - `timeout`: Set the timeout for WebSocket requests (default: 5000 ms).
241
+ - `reconnect_delay`: Delay (ms) between reconnections.
242
+ - `compression`: Enable response compression.
243
+ - `proxy`: Proxy configuration:
244
+ - `host`: Proxy server hostname.
245
+ - `port`: Proxy server port.
246
+ - `protocol`: Proxy protocol (http or https).
247
+ - `auth`: Proxy authentication credentials:
248
+ - `username`: Proxy username.
249
+ - `password`: Proxy password.
250
+ - `mode`: Choose between `single` and `pool` connection modes.
251
+ - `single`: A single WebSocket connection.
252
+ - `pool`: A pool of WebSocket connections.
253
+ - `pool_size`: Define the number of WebSocket connections in pool mode.
254
+ - `time_unit`: Specify the time unit for timestamps (e.g., milliseconds or microseconds).
255
+ - `private_key`: RSA or ED25519 private key for authentication.
256
+ - `private_key_passphrase`: Passphrase for the private key, if encrypted.
257
+ - `https_agent`: Custom HTTPS agent for advanced TLS configuration.
258
+ - `user_agent`: Custom user agent string for WebSocket Streams.
259
+
260
+ ##### Timeout
261
+
262
+ Set the timeout for WebSocket API requests in milliseconds. See the [Timeout example](./docs/websocket_api/timeout.md) for detailed usage.
263
+
264
+ ##### Reconnect Delay
265
+
266
+ Specify the delay in milliseconds between WebSocket reconnection attempts. See the [Reconnect Delay example](./docs/websocket_api/reconnect-delay.md) for detailed usage.
267
+
268
+ ##### Compression
269
+
270
+ Enable or disable compression for WebSocket messages. See the [Compression example](./docs/websocket_api/compression.md) for detailed usage.
271
+
272
+ ##### Proxy
273
+
274
+ The WebSocket API supports HTTP/HTTPS proxy configurations. See the [Proxy example](./docs/websocket_api/proxy.md) for detailed usage.
275
+
276
+
277
+ ##### Connection Mode
278
+
279
+ Choose between `single` and `pool` connection modes for WebSocket connections. The `single` mode uses a single WebSocket connection, while the `pool` mode uses a pool of WebSocket connections. See the [Connection Mode example](./docs/websocket_api/connection-mode.md) for detailed usage.
280
+
281
+ ##### Time Unit
282
+
283
+ Specify the time unit for WebSocket API timestamps (e.g., milliseconds or microseconds). See the [Time Unit example](./docs/websocket_api/time-unit.md) for detailed usage.
284
+
285
+ ##### Key Pair Based Authentication
286
+
287
+ Use RSA or ED25519 private keys for WebSocket API authentication. See the [Key Pair Authentication example](./docs/websocket_api/key-pair-authentication.md) for detailed usage.
288
+
289
+ ##### WebSocket Http Agent
290
+
291
+ Customize the agent for advanced configurations. See the [WebSocket Http Agent example](./docs/websocket_api/agent.md) for detailed usage.
292
+
293
+ #### Testnet
294
+
295
+ For testing purposes, the Websocket API also supports a testnet environment. Update the `wsURL` in your configuration:
296
+
297
+ ```python
298
+ from binance_common.configuration import ConfigurationWebSocketAPI
299
+ from binance_common.constants import SPOT_WS_API_TESTNET_URL
300
+ from binance_sdk_spot.spot import Spot
301
+
302
+ configuration_ws_api = ConfigurationWebSocketAPI(
303
+ api_key="your-api-key",
304
+ api_secret="your-api-secret",
305
+ stream_url=SPOT_WS_API_TESTNET_URL
306
+ )
307
+ client = Spot(config_ws_api=configuration_ws_api)
308
+ ```
309
+
310
+ If `wsURL` is not provided, it defaults to `wss://ws-api.binance.com:443/ws-api/v3`.
311
+
312
+ ### Websocket Streams
313
+
314
+ WebSocket Streams provide real-time data feeds for market trades, candlesticks, and more. Use the [websocket-streams](./src/binance_sdk_spot/websocket_streams/websocket_streams.py) module to subscribe to these streams.
315
+
316
+ ```python
317
+ import asyncio
318
+ import logging
319
+
320
+ from binance_common.configuration import ConfigurationWebSocketStreams
321
+ from binance_common.constants import SPOT_WS_STREAMS_PROD_URL
322
+ from binance_sdk_spot.spot import Spot
323
+
324
+ logging.basicConfig(level=logging.INFO)
325
+
326
+ configuration_ws_streams = ConfigurationWebSocketStreams(
327
+ stream_url=SPOT_WS_STREAMS_PROD_URL,
328
+ )
329
+
330
+ client = Spot(config_ws_streams=configuration_ws_streams)
331
+
332
+
333
+ async def agg_trade():
334
+ connection = None
335
+ try:
336
+ connection = await client.websocket_streams.create_connection()
337
+
338
+ stream = await connection.agg_trade(
339
+ symbol="bnbusdt",
340
+ )
341
+ stream.on("message", lambda data: print(f"{data}"))
342
+
343
+ await asyncio.sleep(5)
344
+ await stream.unsubscribe()
345
+ except Exception as e:
346
+ logging.error(f"agg_trade() error: {e}")
347
+ finally:
348
+ if connection:
349
+ await connection.close_connection(close_session=True)
350
+
351
+
352
+ if __name__ == "__main__":
353
+ asyncio.run(agg_trade())
354
+ ```
355
+
356
+ More examples are available in the [`examples/websocket-streams`](./examples/websocket_streams/) folder.
357
+
358
+ #### Configuration Options
359
+
360
+ The WebSocket Streams API supports the following advanced configuration options:
361
+
362
+ - `reconnect_delay`: Delay (ms) between reconnections.
363
+ - `compression`: Enable response compression.
364
+ - `proxy`: Proxy configuration:
365
+ - `host`: Proxy server hostname.
366
+ - `port`: Proxy server port.
367
+ - `protocol`: Proxy protocol (http or https).
368
+ - `auth`: Proxy authentication credentials:
369
+ - `username`: Proxy username.
370
+ - `password`: Proxy password.
371
+ - `mode`: Choose between `single` and `pool` connection modes.
372
+ - `single`: A single WebSocket connection.
373
+ - `pool`: A pool of WebSocket connections.
374
+ - `pool_size`: Define the number of WebSocket connections in pool mode.
375
+ - `time_unit`: Specify the time unit for timestamps (e.g., milliseconds or microseconds).
376
+ - `https_agent`: Custom HTTPS agent for advanced TLS configuration.
377
+ - `user_agent`: Custom user agent string for WebSocket Streams.
378
+
379
+ ##### Reconnect Delay
380
+
381
+ Specify the delay in milliseconds between WebSocket reconnection attempts for streams. See the [Reconnect Delay example](./docs/websocket_streams/reconnect-delay.md) for detailed usage.
382
+
383
+ ##### Compression
384
+
385
+ Enable or disable compression for WebSocket Streams messages. See the [Compression example](./docs/websocket_streams/compression.md) for detailed usage.
386
+
387
+ ##### Proxy
388
+
389
+ The WebSocket Streams supports HTTP/HTTPS proxy configurations. See the [Proxy example](./docs/websocket_streams/proxy.md) for detailed usage.
390
+
391
+ ##### Connection Mode
392
+
393
+ Choose between `single` and `pool` connection modes for WebSocket Streams. The `single` mode uses a single WebSocket connection, while the `pool` mode uses a pool of WebSocket connections. See the [Connection Mode example](./docs/websocket_streams/connection-mode.md) for detailed usage.
394
+
395
+ ##### Time Unit
396
+
397
+ Specify the time unit for WebSocket Streams timestamps (e.g., milliseconds or microseconds). See the [Time Unit example](./docs/websocket_streams/time-unit.md) for detailed usage.
398
+
399
+ ##### WebSocket Http Agent
400
+
401
+ Customize the agent for advanced configurations. See the [WebSocket Http Agent example](./docs/websocket_streams/agent.md) for detailed usage.
402
+
403
+ #### Unsubscribing from Streams
404
+
405
+ You can unsubscribe from specific WebSocket streams using the `unsubscribe` method. This is useful for managing active subscriptions without closing the connection.
406
+
407
+ ```python
408
+ import asyncio
409
+ import logging
410
+
411
+ from binance_common.configuration import ConfigurationWebSocketStreams
412
+ from binance_sdk_spot.spot import Spot
413
+
414
+ logging.basicConfig(level=logging.INFO)
415
+
416
+ client = Spot(config_ws_streams=ConfigurationWebSocketStreams())
417
+
418
+
419
+ async def agg_trade():
420
+ connection = None
421
+ try:
422
+ connection = await client.websocket_streams.create_connection()
423
+
424
+ stream = await connection.agg_trade(
425
+ symbol="bnbusdt",
426
+ )
427
+ stream.on("message", lambda data: print(f"{data}"))
428
+
429
+ await asyncio.sleep(5)
430
+ await stream.unsubscribe()
431
+ except Exception as e:
432
+ logging.error(f"agg_trade() error: {e}")
433
+ finally:
434
+ if connection:
435
+ await connection.close_connection(close_session=True)
436
+
437
+
438
+ if __name__ == "__main__":
439
+ asyncio.run(agg_trade())
440
+ ```
441
+
442
+ #### Testnet
443
+
444
+ Websocket Streams also support a testnet environment for development and testing. Update the `wsURL` in your configuration:
445
+
446
+ ```python
447
+ from binance_common.configuration import ConfigurationWebSocketStreams
448
+ from binance_common.constants import SPOT_WS_API_TESTNET_URL
449
+ from binance_sdk_spot.spot import Spot
450
+
451
+ config_ws_streams = ConfigurationWebSocketStreams(
452
+ stream_url=SPOT_WS_STREAMS_TESTNET_URL
453
+ )
454
+
455
+ client = Spot(config_ws_streams=config_ws_streams)
456
+ ```
457
+
458
+ If `wsURL` is not provided, it defaults to `wss://stream.binance.com:9443`.
459
+
460
+ ### Automatic Connection Renewal
461
+
462
+ The WebSocket connection is automatically renewed for both WebSocket API and WebSocket Streams connections, before the 24 hours expiration of the API key. This ensures continuous connectivity.
463
+
464
+ ## Testing
465
+
466
+ To run the tests, ensure you have [Poetry](https://python-poetry.org/) installed, then execute the following commands:
467
+
468
+ ```bash
469
+ poetry install
470
+ poetry run pytest ./tests
471
+ ```
472
+
473
+ The tests cover: - REST API endpoints - WebSocket API and Streams - Error handling and edge cases
474
+
475
+ ## Migration Guide
476
+
477
+ If you are upgrading to the new modularized structure, refer to the [Migration Guide](./docs/migration_guide_spot_sdk.md) for detailed steps.
478
+
479
+ ## Contributing
480
+
481
+ Contributions are welcome!
482
+
483
+ Since this repository contains auto-generated code, we encourage you to start by opening a GitHub issue to discuss your ideas or suggest improvements. This helps ensure that changes align with the project's goals and auto-generation processes.
484
+
485
+ To contribute:
486
+
487
+ 1. Open a GitHub issue describing your suggestion or the bug you've identified.
488
+ 2. If it's determined that changes are necessary, the maintainers will merge the changes into the main branch.
489
+
490
+ Please ensure that all tests pass if you're making a direct contribution. Submit a pull request only after discussing and confirming the change.
491
+
492
+ Thank you for your contributions!
493
+
494
+ ## Licence
495
+
496
+ This project is licensed under the MIT License. See the [LICENCE](./LICENCE) file for details.
497
+