crypticorn 2.1.6__tar.gz → 2.2.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 (282) hide show
  1. crypticorn-2.2.0/PKG-INFO +146 -0
  2. crypticorn-2.2.0/README.md +108 -0
  3. crypticorn-2.2.0/crypticorn/auth/main.py +28 -0
  4. crypticorn-2.2.0/crypticorn/client.py +107 -0
  5. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/common/__init__.py +1 -2
  6. crypticorn-2.1.6/crypticorn/common/auth_client.py → crypticorn-2.2.0/crypticorn/common/auth.py +35 -30
  7. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/common/scopes.py +2 -2
  8. crypticorn-2.2.0/crypticorn/common/urls.py +37 -0
  9. crypticorn-2.2.0/crypticorn/hive/main.py +26 -0
  10. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/main.py +2 -12
  11. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/main.py +4 -14
  12. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/main.py +2 -12
  13. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/main.py +2 -12
  14. crypticorn-2.2.0/crypticorn.egg-info/PKG-INFO +146 -0
  15. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn.egg-info/SOURCES.txt +0 -1
  16. {crypticorn-2.1.6 → crypticorn-2.2.0}/pyproject.toml +1 -1
  17. {crypticorn-2.1.6 → crypticorn-2.2.0}/tests/test_auth_client.py +5 -8
  18. crypticorn-2.1.6/PKG-INFO +0 -92
  19. crypticorn-2.1.6/README.md +0 -54
  20. crypticorn-2.1.6/crypticorn/auth/main.py +0 -45
  21. crypticorn-2.1.6/crypticorn/client.py +0 -58
  22. crypticorn-2.1.6/crypticorn/common/auth.py +0 -14
  23. crypticorn-2.1.6/crypticorn/common/urls.py +0 -26
  24. crypticorn-2.1.6/crypticorn/hive/main.py +0 -34
  25. crypticorn-2.1.6/crypticorn.egg-info/PKG-INFO +0 -92
  26. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/__init__.py +0 -0
  27. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/__init__.py +0 -0
  28. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/__init__.py +0 -0
  29. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api/__init__.py +0 -0
  30. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api/admin_api.py +0 -0
  31. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api/auth_api.py +0 -0
  32. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api/service_api.py +0 -0
  33. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api/user_api.py +0 -0
  34. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api/wallet_api.py +0 -0
  35. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api_client.py +0 -0
  36. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/api_response.py +0 -0
  37. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/configuration.py +0 -0
  38. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/exceptions.py +0 -0
  39. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/__init__.py +0 -0
  40. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/add_wallet200_response.py +0 -0
  41. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/add_wallet_request.py +0 -0
  42. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/authorize_user200_response.py +0 -0
  43. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/authorize_user200_response_auth.py +0 -0
  44. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/authorize_user_request.py +0 -0
  45. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/create_api_key200_response.py +0 -0
  46. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/create_api_key_request.py +0 -0
  47. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/create_user_request.py +0 -0
  48. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/get_api_keys200_response_inner.py +0 -0
  49. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response.py +0 -0
  50. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +0 -0
  51. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +0 -0
  52. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +0 -0
  53. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +0 -0
  54. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response_data_inner.py +0 -0
  55. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/list_wallets200_response_user_value.py +0 -0
  56. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/logout_default_response.py +0 -0
  57. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/logout_default_response_issues_inner.py +0 -0
  58. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/oauth_callback200_response.py +0 -0
  59. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/oauth_callback200_response_user.py +0 -0
  60. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/refresh_token_info200_response.py +0 -0
  61. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +0 -0
  62. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/resend_verification_email_request.py +0 -0
  63. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/revoke_user_tokens_request.py +0 -0
  64. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/rotate_tokens200_response.py +0 -0
  65. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/token_info200_response.py +0 -0
  66. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/unlink_wallet_request.py +0 -0
  67. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/update_user_request.py +0 -0
  68. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/user_reset_password_request.py +0 -0
  69. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/user_set_password_request.py +0 -0
  70. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/verify200_response.py +0 -0
  71. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/verify_email200_response.py +0 -0
  72. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/verify_email200_response_auth.py +0 -0
  73. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/verify_email200_response_auth_auth.py +0 -0
  74. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/verify_email_request.py +0 -0
  75. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/verify_wallet_request.py +0 -0
  76. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/wallet_verified200_response.py +0 -0
  77. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/models/whoami200_response.py +0 -0
  78. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/py.typed +0 -0
  79. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/auth/client/rest.py +0 -0
  80. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/common/errors.py +0 -0
  81. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/common/sorter.py +0 -0
  82. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/__init__.py +0 -0
  83. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/__init__.py +0 -0
  84. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/api/__init__.py +0 -0
  85. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/api/data_api.py +0 -0
  86. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/api/models_api.py +0 -0
  87. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/api/status_api.py +0 -0
  88. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/api_client.py +0 -0
  89. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/api_response.py +0 -0
  90. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/configuration.py +0 -0
  91. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/exceptions.py +0 -0
  92. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/__init__.py +0 -0
  93. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/coins.py +0 -0
  94. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/data_download_response.py +0 -0
  95. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/data_info.py +0 -0
  96. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/data_value_value_value_inner.py +0 -0
  97. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/data_version.py +0 -0
  98. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/download_links.py +0 -0
  99. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/evaluation.py +0 -0
  100. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/evaluation_response.py +0 -0
  101. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/feature_size.py +0 -0
  102. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/http_validation_error.py +0 -0
  103. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/model.py +0 -0
  104. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/model_create.py +0 -0
  105. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/model_status.py +0 -0
  106. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/model_update.py +0 -0
  107. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/target.py +0 -0
  108. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/target_type.py +0 -0
  109. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/validation_error.py +0 -0
  110. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/models/validation_error_loc_inner.py +0 -0
  111. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/py.typed +0 -0
  112. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/hive/client/rest.py +0 -0
  113. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/__init__.py +0 -0
  114. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/__init__.py +0 -0
  115. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api/__init__.py +0 -0
  116. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api/funding_rates_api.py +0 -0
  117. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api/health_check_api.py +0 -0
  118. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api/ohlcv_data_api.py +0 -0
  119. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api/symbols_api.py +0 -0
  120. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api/udf_api.py +0 -0
  121. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api_client.py +0 -0
  122. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/api_response.py +0 -0
  123. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/configuration.py +0 -0
  124. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/exceptions.py +0 -0
  125. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/__init__.py +0 -0
  126. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/base_response_health_check_response.py +0 -0
  127. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -0
  128. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/base_response_list_str.py +0 -0
  129. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -0
  130. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/error_response.py +0 -0
  131. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/exchange.py +0 -0
  132. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/funding_rate_response.py +0 -0
  133. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/health_check_response.py +0 -0
  134. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/history_error_response.py +0 -0
  135. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/history_no_data_response.py +0 -0
  136. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/history_success_response.py +0 -0
  137. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/http_validation_error.py +0 -0
  138. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/market.py +0 -0
  139. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/ohlcv_response.py +0 -0
  140. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/resolution.py +0 -0
  141. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -0
  142. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/search_symbol_response.py +0 -0
  143. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/sort_direction.py +0 -0
  144. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/symbol_group_response.py +0 -0
  145. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/symbol_info_response.py +0 -0
  146. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/symbol_type.py +0 -0
  147. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/timeframe.py +0 -0
  148. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/udf_config_response.py +0 -0
  149. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/validation_error.py +0 -0
  150. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/models/validation_error_loc_inner.py +0 -0
  151. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/py.typed +0 -0
  152. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/klines/client/rest.py +0 -0
  153. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/__init__.py +0 -0
  154. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/__init__.py +0 -0
  155. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/__init__.py +0 -0
  156. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/exchanges_api.py +0 -0
  157. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/health_check_api.py +0 -0
  158. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/indicators_api.py +0 -0
  159. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/logs_api.py +0 -0
  160. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/marketcap_api.py +0 -0
  161. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/markets_api.py +0 -0
  162. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api/tokens_api.py +0 -0
  163. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api_client.py +0 -0
  164. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/api_response.py +0 -0
  165. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/configuration.py +0 -0
  166. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/exceptions.py +0 -0
  167. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/__init__.py +0 -0
  168. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/base_response_dict.py +0 -0
  169. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/base_response_health_check_response.py +0 -0
  170. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/base_response_list_dict.py +0 -0
  171. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -0
  172. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/base_response_list_str.py +0 -0
  173. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/error_response.py +0 -0
  174. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/exchange_mapping.py +0 -0
  175. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/health_check_response.py +0 -0
  176. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/http_validation_error.py +0 -0
  177. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/market.py +0 -0
  178. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/severity.py +0 -0
  179. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/validation_error.py +0 -0
  180. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -0
  181. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/py.typed +0 -0
  182. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/metrics/client/rest.py +0 -0
  183. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/__init__.py +0 -0
  184. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/__init__.py +0 -0
  185. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api/__init__.py +0 -0
  186. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api/now_payments_api.py +0 -0
  187. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api/payments_api.py +0 -0
  188. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api/products_api.py +0 -0
  189. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api/status_api.py +0 -0
  190. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api_client.py +0 -0
  191. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/api_response.py +0 -0
  192. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/configuration.py +0 -0
  193. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/exceptions.py +0 -0
  194. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/__init__.py +0 -0
  195. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/api_status_res.py +0 -0
  196. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/body_create_now_invoice.py +0 -0
  197. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/body_create_product.py +0 -0
  198. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/body_get_products.py +0 -0
  199. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/body_handle_now_webhook.py +0 -0
  200. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/body_update_product.py +0 -0
  201. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/combined_payment_history.py +0 -0
  202. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/create_invoice_req.py +0 -0
  203. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/create_invoice_res.py +0 -0
  204. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/currency.py +0 -0
  205. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/estimate_price_req.py +0 -0
  206. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/estimate_price_res.py +0 -0
  207. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/get_currencies_res.py +0 -0
  208. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/get_payment_status_res.py +0 -0
  209. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/get_payments_list_res.py +0 -0
  210. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/http_validation_error.py +0 -0
  211. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/min_amount_req.py +0 -0
  212. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/min_amount_res.py +0 -0
  213. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_api_status_res.py +0 -0
  214. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_create_invoice_req.py +0 -0
  215. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_create_invoice_res.py +0 -0
  216. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_fee_structure.py +0 -0
  217. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_payment_model.py +0 -0
  218. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_payment_status.py +0 -0
  219. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/now_webhook_payload.py +0 -0
  220. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/payment.py +0 -0
  221. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/payment_status.py +0 -0
  222. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/product.py +0 -0
  223. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/product_model.py +0 -0
  224. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/product_subs_model.py +0 -0
  225. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/scope.py +0 -0
  226. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/services.py +0 -0
  227. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/unified_payment_model.py +0 -0
  228. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/validation_error.py +0 -0
  229. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/models/validation_error_loc_inner.py +0 -0
  230. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/py.typed +0 -0
  231. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/pay/client/rest.py +0 -0
  232. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/__init__.py +0 -0
  233. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/__init__.py +0 -0
  234. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/__init__.py +0 -0
  235. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/api_keys_api.py +0 -0
  236. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/bots_api.py +0 -0
  237. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/exchanges_api.py +0 -0
  238. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/futures_trading_panel_api.py +0 -0
  239. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/notifications_api.py +0 -0
  240. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/orders_api.py +0 -0
  241. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/status_api.py +0 -0
  242. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/strategies_api.py +0 -0
  243. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api/trading_actions_api.py +0 -0
  244. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api_client.py +0 -0
  245. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/api_response.py +0 -0
  246. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/configuration.py +0 -0
  247. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/exceptions.py +0 -0
  248. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/__init__.py +0 -0
  249. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/action_model.py +0 -0
  250. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/api_error_identifier.py +0 -0
  251. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/api_error_level.py +0 -0
  252. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/api_error_type.py +0 -0
  253. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/api_key_model.py +0 -0
  254. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/bot_model.py +0 -0
  255. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/bot_status.py +0 -0
  256. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/exchange.py +0 -0
  257. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/execution_ids.py +0 -0
  258. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/futures_balance.py +0 -0
  259. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/futures_trading_action.py +0 -0
  260. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/http_validation_error.py +0 -0
  261. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/margin_mode.py +0 -0
  262. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/market_type.py +0 -0
  263. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/notification_model.py +0 -0
  264. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/order_model.py +0 -0
  265. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/order_status.py +0 -0
  266. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/post_futures_action.py +0 -0
  267. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/strategy_exchange_info.py +0 -0
  268. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/strategy_model_input.py +0 -0
  269. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/strategy_model_output.py +0 -0
  270. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/tpsl.py +0 -0
  271. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/trading_action_type.py +0 -0
  272. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/validation_error.py +0 -0
  273. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/models/validation_error_loc_inner.py +0 -0
  274. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/py.typed +0 -0
  275. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn/trade/client/rest.py +0 -0
  276. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn.egg-info/dependency_links.txt +0 -0
  277. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn.egg-info/requires.txt +0 -0
  278. {crypticorn-2.1.6 → crypticorn-2.2.0}/crypticorn.egg-info/top_level.txt +0 -0
  279. {crypticorn-2.1.6 → crypticorn-2.2.0}/requirements/dev.txt +0 -0
  280. {crypticorn-2.1.6 → crypticorn-2.2.0}/requirements/main.txt +0 -0
  281. {crypticorn-2.1.6 → crypticorn-2.2.0}/requirements/test.txt +0 -0
  282. {crypticorn-2.1.6 → crypticorn-2.2.0}/setup.cfg +0 -0
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.4
2
+ Name: crypticorn
3
+ Version: 2.2.0
4
+ Summary: Maximise Your Crypto Trading Profits with AI Predictions
5
+ Author-email: Crypticorn <timon@crypticorn.com>
6
+ Project-URL: Homepage, https://crypticorn.com
7
+ Keywords: machine learning,data science,crypto,modelling
8
+ Classifier: Topic :: Scientific/Engineering
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Typing :: Typed
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: fastapi
17
+ Requires-Dist: urllib3<3.0.0,>=1.25.3
18
+ Requires-Dist: python_dateutil<3.0.0,>=2.8.2
19
+ Requires-Dist: aiohttp<4.0.0,>=3.8.4
20
+ Requires-Dist: aiohttp-retry<3.0.0,>=2.8.3
21
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
22
+ Requires-Dist: typing-extensions<5.0.0,>=4.7.1
23
+ Requires-Dist: pandas<3.0.0,>=2.2.0
24
+ Requires-Dist: requests<3.0.0,>=2.32.0
25
+ Requires-Dist: tqdm<5.0.0,>=4.67.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: streamlit; extra == "dev"
28
+ Requires-Dist: httpx; extra == "dev"
29
+ Requires-Dist: build; extra == "dev"
30
+ Requires-Dist: black; extra == "dev"
31
+ Requires-Dist: twine; extra == "dev"
32
+ Requires-Dist: pyflakes; extra == "dev"
33
+ Provides-Extra: test
34
+ Requires-Dist: pytest==8.3.5; extra == "test"
35
+ Requires-Dist: pytest-asyncio==0.26.0; extra == "test"
36
+ Requires-Dist: pytest-cov==6.1.1; extra == "test"
37
+ Requires-Dist: python-dotenv==1.0.1; extra == "test"
38
+
39
+ # What is Crypticorn?
40
+
41
+ Crypticorn is at the forefront of cutting-edge artificial intelligence cryptocurrency trading.
42
+ Crypticorn offers AI-based solutions for both active and passive investors, including:
43
+ - Prediction Dashboard with trading terminal,
44
+ - AI Agents with different strategies,
45
+ - DEX AI Signals for newly launched tokens,
46
+ - DEX AI Bots
47
+
48
+ Use this API Client to contribute to the so-called Hive AI, a community driven AI Meta Model for predicting the
49
+ cryptocurrency market.
50
+
51
+ ## Installation
52
+
53
+ You can install the latest stable version from PyPi:
54
+ ```bash
55
+ pip install crypticorn
56
+ ```
57
+
58
+ If you want a specific version, run:
59
+ ```bash
60
+ pip install crypticorn==2.0.0
61
+ ```
62
+
63
+ If you want the latest version, which could be a pre release, run:
64
+ ```bash
65
+ pip install --pre crypticorn
66
+ ```
67
+
68
+ ## Structure
69
+
70
+ Our API is available as an asynchronous Python SDK. The main entry point you need is the `ApiClient` class, which you would import like this:
71
+ ```python
72
+ from crypticorn import ApiClient
73
+ ```
74
+
75
+ ## Usage
76
+
77
+ ### With Async Context Protocol
78
+ ```python
79
+ async with ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key") as client:
80
+ await client.pay.products.get_products()
81
+ ```
82
+
83
+ ### Without Async Context Protocol
84
+ Without the context you need to close the session manually.
85
+ ```python
86
+ client = ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key")
87
+ asyncio.run(client.pay.models.get_products())
88
+ asyncio.run(client.close())
89
+ ```
90
+
91
+ ## Response Types
92
+
93
+ There are three different available output formats you can choose from:
94
+
95
+ ### Serialized Response
96
+ You can get fully serialized responses as pydantic models. Using this, you get the full benefits of pydantic's type checking.
97
+ ```python
98
+ response = await client.pay.products.get_products()
99
+ print(response)
100
+ ```
101
+ The output would look like this:
102
+ ```python
103
+ [ProductModel(id='67e8146e7bae32f3838fe36a', name='Awesome Product', price=5.0, scopes=None, duration=30, description='You need to buy this', is_active=True)]
104
+ ```
105
+
106
+ ### Serialized Response with HTTP Info
107
+ ```python
108
+ await client.pay.products.get_products_with_http_info()
109
+ print(res)
110
+ ```
111
+ The output would look like this:
112
+ ```python
113
+ status_code=200 headers={'Date': 'Wed, 09 Apr 2025 19:15:19 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Alt-Svc': 'h3=":443"; ma=86400', 'Server': 'cloudflare', 'Cf-Cache-Status': 'DYNAMIC', 'Content-Encoding': 'gzip', 'CF-RAY': '92dc551a687bbe5e-ZRH'} data=[ProductModel(id='67e8146e7bae32f3838fe36a', name='Awesome Product', price=5.0, scopes=None, duration=30, description='You need to buy this', is_active=True)] raw_data=b'[{"id":"67e8146e7bae32f3838fe36a","name":"Awesome Product","price":5.0,"duration":30,"description":"You need to buy this","is_active":true}]'
114
+ ```
115
+ You can then access the data of the response (as serialized output) with:
116
+ ```python
117
+ print(res.data)
118
+ ```
119
+ On top of that you get some information about the request:
120
+ ```python
121
+ print(res.status_code)
122
+ print(res.raw_data)
123
+ print(res.headers)
124
+
125
+
126
+ ### JSON Response
127
+ You can receive a classical JSON response by suffixing the function name with `_without_preload_content`
128
+ ```python
129
+ response = await client.pay.products.get_products_without_preload_content()
130
+ print(await response.json())
131
+ ```
132
+ The output would look like this:
133
+ ```python
134
+ [{'id': '67e8146e7bae32f3838fe36a', 'name': 'Awesome Product', 'price': 5.0, 'duration': 30, 'description': 'You need to buy this', 'is_active': True}]
135
+ ```
136
+
137
+ ## Advanced Usage
138
+
139
+ You can override some configuration for specific sub clients. If just want to use the API as is you don't need to configure anything.
140
+ This might be of use if you are testing a specific API locally.
141
+
142
+ This will override the host for the Hive client to connect to http://localhost:8000 instead of the default caddy proxy:
143
+ ```python
144
+ async with ApiClient(base_url=BaseUrl.DEV, jwt=jwt) as client:
145
+ client.configure(config=HiveConfig(host="http://localhost:8000"), sub_client=client.hive)
146
+ ```
@@ -0,0 +1,108 @@
1
+ # What is Crypticorn?
2
+
3
+ Crypticorn is at the forefront of cutting-edge artificial intelligence cryptocurrency trading.
4
+ Crypticorn offers AI-based solutions for both active and passive investors, including:
5
+ - Prediction Dashboard with trading terminal,
6
+ - AI Agents with different strategies,
7
+ - DEX AI Signals for newly launched tokens,
8
+ - DEX AI Bots
9
+
10
+ Use this API Client to contribute to the so-called Hive AI, a community driven AI Meta Model for predicting the
11
+ cryptocurrency market.
12
+
13
+ ## Installation
14
+
15
+ You can install the latest stable version from PyPi:
16
+ ```bash
17
+ pip install crypticorn
18
+ ```
19
+
20
+ If you want a specific version, run:
21
+ ```bash
22
+ pip install crypticorn==2.0.0
23
+ ```
24
+
25
+ If you want the latest version, which could be a pre release, run:
26
+ ```bash
27
+ pip install --pre crypticorn
28
+ ```
29
+
30
+ ## Structure
31
+
32
+ Our API is available as an asynchronous Python SDK. The main entry point you need is the `ApiClient` class, which you would import like this:
33
+ ```python
34
+ from crypticorn import ApiClient
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ ### With Async Context Protocol
40
+ ```python
41
+ async with ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key") as client:
42
+ await client.pay.products.get_products()
43
+ ```
44
+
45
+ ### Without Async Context Protocol
46
+ Without the context you need to close the session manually.
47
+ ```python
48
+ client = ApiClient(base_url=BaseUrl.Prod, api_key="your-api-key")
49
+ asyncio.run(client.pay.models.get_products())
50
+ asyncio.run(client.close())
51
+ ```
52
+
53
+ ## Response Types
54
+
55
+ There are three different available output formats you can choose from:
56
+
57
+ ### Serialized Response
58
+ You can get fully serialized responses as pydantic models. Using this, you get the full benefits of pydantic's type checking.
59
+ ```python
60
+ response = await client.pay.products.get_products()
61
+ print(response)
62
+ ```
63
+ The output would look like this:
64
+ ```python
65
+ [ProductModel(id='67e8146e7bae32f3838fe36a', name='Awesome Product', price=5.0, scopes=None, duration=30, description='You need to buy this', is_active=True)]
66
+ ```
67
+
68
+ ### Serialized Response with HTTP Info
69
+ ```python
70
+ await client.pay.products.get_products_with_http_info()
71
+ print(res)
72
+ ```
73
+ The output would look like this:
74
+ ```python
75
+ status_code=200 headers={'Date': 'Wed, 09 Apr 2025 19:15:19 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Alt-Svc': 'h3=":443"; ma=86400', 'Server': 'cloudflare', 'Cf-Cache-Status': 'DYNAMIC', 'Content-Encoding': 'gzip', 'CF-RAY': '92dc551a687bbe5e-ZRH'} data=[ProductModel(id='67e8146e7bae32f3838fe36a', name='Awesome Product', price=5.0, scopes=None, duration=30, description='You need to buy this', is_active=True)] raw_data=b'[{"id":"67e8146e7bae32f3838fe36a","name":"Awesome Product","price":5.0,"duration":30,"description":"You need to buy this","is_active":true}]'
76
+ ```
77
+ You can then access the data of the response (as serialized output) with:
78
+ ```python
79
+ print(res.data)
80
+ ```
81
+ On top of that you get some information about the request:
82
+ ```python
83
+ print(res.status_code)
84
+ print(res.raw_data)
85
+ print(res.headers)
86
+
87
+
88
+ ### JSON Response
89
+ You can receive a classical JSON response by suffixing the function name with `_without_preload_content`
90
+ ```python
91
+ response = await client.pay.products.get_products_without_preload_content()
92
+ print(await response.json())
93
+ ```
94
+ The output would look like this:
95
+ ```python
96
+ [{'id': '67e8146e7bae32f3838fe36a', 'name': 'Awesome Product', 'price': 5.0, 'duration': 30, 'description': 'You need to buy this', 'is_active': True}]
97
+ ```
98
+
99
+ ## Advanced Usage
100
+
101
+ You can override some configuration for specific sub clients. If just want to use the API as is you don't need to configure anything.
102
+ This might be of use if you are testing a specific API locally.
103
+
104
+ This will override the host for the Hive client to connect to http://localhost:8000 instead of the default caddy proxy:
105
+ ```python
106
+ async with ApiClient(base_url=BaseUrl.DEV, jwt=jwt) as client:
107
+ client.configure(config=HiveConfig(host="http://localhost:8000"), sub_client=client.hive)
108
+ ```
@@ -0,0 +1,28 @@
1
+ from crypticorn.auth import (
2
+ ApiClient,
3
+ Configuration,
4
+ AdminApi,
5
+ ServiceApi,
6
+ UserApi,
7
+ WalletApi,
8
+ AuthApi,
9
+ )
10
+
11
+
12
+ class AuthClient:
13
+ """
14
+ A client for interacting with the Crypticorn Auth API.
15
+ """
16
+
17
+ def __init__(
18
+ self,
19
+ config: Configuration,
20
+ ):
21
+ self.config = config
22
+ self.base_client = ApiClient(configuration=self.config)
23
+ # Instantiate all the endpoint clients
24
+ self.admin = AdminApi(self.base_client)
25
+ self.service = ServiceApi(self.base_client)
26
+ self.user = UserApi(self.base_client)
27
+ self.wallet = WalletApi(self.base_client)
28
+ self.login = AuthApi(self.base_client)
@@ -0,0 +1,107 @@
1
+ from crypticorn.hive import HiveClient, Configuration
2
+ from crypticorn.klines import KlinesClient
3
+ from crypticorn.pay import PayClient
4
+ from crypticorn.trade import TradeClient
5
+ from crypticorn.metrics import MetricsClient
6
+ from crypticorn.auth import AuthClient
7
+ from crypticorn.common import BaseUrl, ApiVersion, Service, apikey_header as aph
8
+ import warnings
9
+ class ApiClient:
10
+ """
11
+ The official client for interacting with the Crypticorn API.
12
+
13
+ It is consisting of multiple microservices covering the whole stack of the Crypticorn project.
14
+ """
15
+
16
+ def __init__(
17
+ self,
18
+ api_key: str = None,
19
+ jwt: str = None,
20
+ base_url: BaseUrl = BaseUrl.PROD,
21
+ ):
22
+ self.base_url = base_url
23
+ '''The base URL the client will use to connect to the API.'''
24
+ self.api_key = api_key
25
+ '''The API key to use for authentication.'''
26
+ self.jwt = jwt
27
+ '''The JWT to use for authentication.'''
28
+
29
+ self.hive = HiveClient(self._get_default_config(Service.HIVE))
30
+ self.trade = TradeClient(self._get_default_config(Service.TRADE))
31
+ self.klines = KlinesClient(self._get_default_config(Service.KLINES))
32
+ self.pay = PayClient(self._get_default_config(Service.PAY))
33
+ self.metrics = MetricsClient(self._get_default_config(Service.METRICS))
34
+ self.auth = AuthClient(self._get_default_config(Service.AUTH))
35
+
36
+ def __new__(cls, *args, **kwargs):
37
+ if kwargs.get("api_key") and not kwargs.get("jwt"):
38
+ # auth-service does not allow api_key
39
+ warnings.warn("The auth module does only accept JWT to be used to authenticate. If you use this module, you need to provide a JWT.")
40
+ return super().__new__(cls)
41
+
42
+ async def close(self):
43
+ """Close all client sessions."""
44
+ clients = [
45
+ self.hive.base_client,
46
+ self.trade.base_client,
47
+ self.klines.base_client,
48
+ self.pay.base_client,
49
+ self.metrics.base_client,
50
+ self.auth.base_client,
51
+ ]
52
+
53
+ for client in clients:
54
+ if hasattr(client, "close"):
55
+ await client.close()
56
+
57
+ def _get_default_config(self, service: Service, version: ApiVersion = ApiVersion.V1):
58
+ """
59
+ Get the default configuration for a given service.
60
+ """
61
+ return Configuration(
62
+ host=f"{self.base_url}/{version}/{service}",
63
+ access_token=self.jwt,
64
+ api_key={aph.scheme_name: self.api_key} if self.api_key else None,
65
+ api_key_prefix=({aph.scheme_name: aph.model.name} if self.api_key else None),
66
+ )
67
+
68
+ def configure(self, config: Configuration, sub_client: any):
69
+ """
70
+ Update a sub-client's configuration by overriding with the values set in the new config.
71
+ Useful for testing a specific service against a local server instead of the default proxy.
72
+
73
+ :param config: The new configuration to use for the sub-client.
74
+ :param sub_client: The sub-client to configure.
75
+
76
+ Example:
77
+ This will override the host for the Hive client to connect to http://localhost:8000 instead of the default proxy:
78
+ >>> async with ApiClient(base_url=BaseUrl.DEV, jwt=jwt) as client:
79
+ >>> client.configure(config=HiveConfig(host="http://localhost:8000"), sub_client=client.hive)
80
+ """
81
+ new_config = sub_client.config
82
+ for attr in vars(config):
83
+ new_value = getattr(config, attr)
84
+ if new_value is not None:
85
+ setattr(new_config, attr, new_value)
86
+
87
+ if sub_client == self.hive:
88
+ self.hive = HiveClient(new_config)
89
+ elif sub_client == self.trade:
90
+ self.trade = TradeClient(new_config)
91
+ elif sub_client == self.klines:
92
+ self.klines = KlinesClient(new_config)
93
+ elif sub_client == self.pay:
94
+ self.pay = PayClient(new_config)
95
+ elif sub_client == self.metrics:
96
+ self.metrics = MetricsClient(new_config)
97
+ elif sub_client == self.auth:
98
+ self.auth = AuthClient(new_config)
99
+ else:
100
+ raise ValueError(f"Unknown sub-client: {sub_client}")
101
+
102
+ async def __aenter__(self):
103
+ return self
104
+
105
+ async def __aexit__(self, exc_type, exc_val, exc_tb):
106
+ await self.close()
107
+
@@ -1,5 +1,4 @@
1
1
  from crypticorn.common.errors import *
2
2
  from crypticorn.common.scopes import *
3
3
  from crypticorn.common.urls import *
4
- from crypticorn.common.auth import *
5
- from crypticorn.common.auth_client import *
4
+ from crypticorn.common.auth import *
@@ -1,46 +1,51 @@
1
- from fastapi import Depends, HTTPException, Query, status
2
- from fastapi.security import HTTPAuthorizationCredentials, SecurityScopes
3
- from typing_extensions import Annotated, Doc
4
1
  import json
5
2
 
6
- from crypticorn.auth import AuthClient, Verify200Response
3
+ from crypticorn.auth import Verify200Response, AuthClient, Configuration
7
4
  from crypticorn.auth.client.exceptions import ApiException
8
5
  from crypticorn.common import (
9
6
  ApiError,
10
- Scope,
11
7
  ApiVersion,
12
- BaseURL,
13
- Domain,
14
- apikey_header,
15
- http_bearer,
8
+ BaseUrl,
9
+ Scope,
10
+ Service,
11
+ )
12
+ from fastapi import Depends, HTTPException, Query, status
13
+ from fastapi.security import (
14
+ HTTPAuthorizationCredentials,
15
+ SecurityScopes,
16
+ HTTPBearer,
17
+ APIKeyHeader,
16
18
  )
19
+ from typing_extensions import Annotated
17
20
 
21
+ # Auth Schemes
22
+ http_bearer = HTTPBearer(
23
+ bearerFormat="JWT",
24
+ auto_error=False,
25
+ description="The JWT to use for authentication.",
26
+ )
27
+
28
+ apikey_header = APIKeyHeader(
29
+ name="X-API-Key",
30
+ auto_error=False,
31
+ description="The API key to use for authentication.",
32
+ )
18
33
 
34
+ # Auth Handler
19
35
  class AuthHandler:
20
36
  """
21
- Middleware for verifying API requests. Verifies the validity of the authentication token, allowed scopes, etc.
37
+ Middleware for verifying API requests. Verifies the validity of the authentication token, scopes, etc.
38
+
39
+ @param base_url: The base URL of the API.
40
+ @param api_version: The version of the API.
22
41
  """
23
42
 
24
43
  def __init__(
25
44
  self,
26
- base_url: Annotated[
27
- BaseURL, Doc("The base URL for the auth service.")
28
- ] = BaseURL.PROD,
29
- api_version: Annotated[
30
- ApiVersion, Doc("The API version of the auth service.")
31
- ] = ApiVersion.V1,
32
- whitelist: Annotated[
33
- list[Domain],
34
- Doc(
35
- "The domains of which requests are allowed full access to the service."
36
- ),
37
- ] = [
38
- Domain.PROD,
39
- Domain.DEV,
40
- ], # TODO: decide whether this is needed, else omit
45
+ base_url: BaseUrl = BaseUrl.PROD,
41
46
  ):
42
- self.whitelist = whitelist
43
- self.auth_client = AuthClient(base_url=base_url, api_version=api_version)
47
+ self.url = f"{base_url}/{ApiVersion.V1}/{Service.AUTH}"
48
+ self.client = AuthClient(Configuration(host=self.url))
44
49
 
45
50
  self.no_credentials_exception = HTTPException(
46
51
  status_code=status.HTTP_401_UNAUTHORIZED,
@@ -51,7 +56,7 @@ class AuthHandler:
51
56
  """
52
57
  Verifies the API key.
53
58
  """
54
- return await self.auth_client.login.verify_api_key(api_key)
59
+ return await self.client.login.verify_api_key(api_key)
55
60
 
56
61
  async def _verify_bearer(
57
62
  self, bearer: HTTPAuthorizationCredentials
@@ -59,8 +64,8 @@ class AuthHandler:
59
64
  """
60
65
  Verifies the bearer token.
61
66
  """
62
- self.auth_client.config.access_token = bearer.credentials
63
- return await self.auth_client.login.verify()
67
+ self.client.config.access_token = bearer.credentials
68
+ return await self.client.login.verify()
64
69
 
65
70
  async def _validate_scopes(
66
71
  self, api_scopes: list[Scope], user_scopes: list[Scope]
@@ -1,7 +1,7 @@
1
- from enum import Enum
1
+ from enum import StrEnum
2
2
 
3
3
 
4
- class Scope(str, Enum):
4
+ class Scope(StrEnum):
5
5
  """
6
6
  The permission scopes for the API.
7
7
  """
@@ -0,0 +1,37 @@
1
+ from enum import StrEnum
2
+
3
+ class ApiEnv(StrEnum):
4
+ PROD = "prod"
5
+ DEV = "dev"
6
+ LOCAL = "local"
7
+ DOCKER = "docker"
8
+
9
+ class BaseUrl(StrEnum):
10
+ PROD = "https://api.crypticorn.com"
11
+ DEV = "https://api.crypticorn.dev"
12
+ LOCAL = "http://localhost"
13
+ DOCKER = "http://host.docker.internal"
14
+
15
+ @classmethod
16
+ def from_env(cls, env: ApiEnv) -> "BaseUrl":
17
+ if env == ApiEnv.PROD:
18
+ return cls.PROD
19
+ elif env == ApiEnv.DEV:
20
+ return cls.DEV
21
+ elif env == ApiEnv.LOCAL:
22
+ return cls.LOCAL
23
+ elif env == ApiEnv.DOCKER:
24
+ return cls.DOCKER
25
+
26
+
27
+ class ApiVersion(StrEnum):
28
+ V1 = "v1"
29
+
30
+
31
+ class Service(StrEnum):
32
+ HIVE = "hive"
33
+ KLINES = "klines"
34
+ PAY = "pay"
35
+ TRADE = "trade"
36
+ AUTH = "auth"
37
+ METRICS = "metrics"
@@ -0,0 +1,26 @@
1
+ from crypticorn.hive import (
2
+ ApiClient,
3
+ Configuration,
4
+ ModelsApi,
5
+ DataApi,
6
+ StatusApi,
7
+ Configuration,
8
+ )
9
+ from crypticorn.common import apikey_header as aph
10
+
11
+
12
+ class HiveClient:
13
+ """
14
+ A client for interacting with the Crypticorn Hive API.
15
+ """
16
+
17
+ def __init__(
18
+ self,
19
+ config: Configuration,
20
+ ):
21
+ self.config = config
22
+ self.base_client = ApiClient(configuration=self.config)
23
+ # Instantiate all the endpoint clients
24
+ self.models = ModelsApi(self.base_client)
25
+ self.data = DataApi(self.base_client)
26
+ self.status = StatusApi(self.base_client)
@@ -8,7 +8,6 @@ from crypticorn.klines import (
8
8
  SymbolsApi,
9
9
  UDFApi,
10
10
  )
11
- from crypticorn.common import BaseURL, ApiVersion, Service, apikey_header as aph
12
11
 
13
12
 
14
13
  class FundingRatesApiWrapper(FundingRatesApi):
@@ -58,18 +57,9 @@ class KlinesClient:
58
57
 
59
58
  def __init__(
60
59
  self,
61
- base_url: BaseURL,
62
- api_version: ApiVersion,
63
- api_key: str = None,
64
- jwt: str = None,
60
+ config: Configuration,
65
61
  ):
66
- self.host = f"{base_url.value}/{api_version.value}/{Service.KLINES.value}"
67
- self.config = Configuration(
68
- host=self.host,
69
- access_token=jwt,
70
- api_key={aph.scheme_name: api_key} if api_key else None,
71
- api_key_prefix=({aph.scheme_name: aph.model.name} if api_key else None),
72
- )
62
+ self.config = config
73
63
  self.base_client = ApiClient(configuration=self.config)
74
64
  # Instantiate all the endpoint clients
75
65
  self.funding = FundingRatesApiWrapper(self.base_client)
@@ -10,10 +10,9 @@ from crypticorn.metrics import (
10
10
  TokensApi,
11
11
  Market,
12
12
  )
13
- from crypticorn.common import BaseURL, ApiVersion, Service, apikey_header as aph
14
- from typing import Optional, Dict, Any, Union, Tuple
15
- from pydantic import StrictStr, StrictInt, StrictFloat, Field
13
+ from pydantic import StrictStr, StrictInt, Field
16
14
  from typing_extensions import Annotated
15
+ from typing import Optional
17
16
 
18
17
  import pandas as pd
19
18
 
@@ -25,18 +24,9 @@ class MetricsClient:
25
24
 
26
25
  def __init__(
27
26
  self,
28
- base_url: BaseURL,
29
- api_version: ApiVersion,
30
- api_key: str = None,
31
- jwt: str = None,
27
+ config: Configuration,
32
28
  ):
33
- self.host = f"{base_url.value}/{api_version.value}/{Service.METRICS.value}"
34
- self.config = Configuration(
35
- host=self.host,
36
- access_token=jwt,
37
- api_key={aph.scheme_name: api_key} if api_key else None,
38
- api_key_prefix=({aph.scheme_name: aph.model.name} if api_key else None),
39
- )
29
+ self.config = config
40
30
  self.base_client = ApiClient(configuration=self.config)
41
31
  # Instantiate all the endpoint clients
42
32
  self.status = HealthCheckApi(self.base_client)
@@ -6,7 +6,6 @@ from crypticorn.pay import (
6
6
  PaymentsApi,
7
7
  ProductsApi,
8
8
  )
9
- from crypticorn.common import BaseURL, ApiVersion, Service, apikey_header as aph
10
9
 
11
10
 
12
11
  class PayClient:
@@ -16,18 +15,9 @@ class PayClient:
16
15
 
17
16
  def __init__(
18
17
  self,
19
- base_url: BaseURL,
20
- api_version: ApiVersion,
21
- api_key: str = None,
22
- jwt: str = None,
18
+ config: Configuration,
23
19
  ):
24
- self.host = f"{base_url.value}/{api_version.value}/{Service.PAY.value}"
25
- self.config = Configuration(
26
- host=self.host,
27
- access_token=jwt,
28
- api_key={aph.scheme_name: api_key} if api_key else None,
29
- api_key_prefix=({aph.scheme_name: aph.model.name} if api_key else None),
30
- )
20
+ self.config = config
31
21
  self.base_client = ApiClient(configuration=self.config)
32
22
  self.now = NOWPaymentsApi(self.base_client)
33
23
  self.status = StatusApi(self.base_client)