crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.0__py3-none-any.whl

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 (259) hide show
  1. crypticorn/__init__.py +3 -3
  2. crypticorn/auth/__init__.py +2 -0
  3. crypticorn/auth/client/__init__.py +112 -0
  4. crypticorn/auth/client/api/__init__.py +8 -0
  5. crypticorn/auth/client/api/admin_api.py +522 -0
  6. crypticorn/auth/client/api/auth_api.py +2089 -0
  7. crypticorn/auth/client/api/service_api.py +309 -0
  8. crypticorn/auth/client/api/user_api.py +2540 -0
  9. crypticorn/auth/client/api/wallet_api.py +1698 -0
  10. crypticorn/auth/client/api_client.py +758 -0
  11. crypticorn/auth/client/api_response.py +20 -0
  12. crypticorn/auth/client/configuration.py +584 -0
  13. crypticorn/auth/client/exceptions.py +220 -0
  14. crypticorn/auth/client/models/__init__.py +91 -0
  15. crypticorn/auth/client/models/add_wallet200_response.py +86 -0
  16. crypticorn/auth/client/models/add_wallet_request.py +107 -0
  17. crypticorn/auth/client/models/authorize_user200_response.py +107 -0
  18. crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
  19. crypticorn/auth/client/models/authorize_user_request.py +96 -0
  20. crypticorn/auth/client/models/create_user_request.py +114 -0
  21. crypticorn/auth/client/models/list_wallets200_response.py +137 -0
  22. crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
  23. crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
  24. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
  25. crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
  26. crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
  27. crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
  28. crypticorn/auth/client/models/logout_default_response.py +108 -0
  29. crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
  30. crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
  31. crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
  32. crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
  33. crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
  34. crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
  35. crypticorn/auth/client/models/token_info200_response.py +97 -0
  36. crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
  37. crypticorn/auth/client/models/update_user_request.py +93 -0
  38. crypticorn/auth/client/models/user_reset_password_request.py +87 -0
  39. crypticorn/auth/client/models/user_set_password_request.py +89 -0
  40. crypticorn/auth/client/models/verify200_response.py +110 -0
  41. crypticorn/auth/client/models/verify_email200_response.py +107 -0
  42. crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
  43. crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
  44. crypticorn/auth/client/models/verify_email_request.py +83 -0
  45. crypticorn/auth/client/models/verify_wallet_request.py +91 -0
  46. crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
  47. crypticorn/auth/client/models/whoami200_response.py +104 -0
  48. crypticorn/auth/client/rest.py +195 -0
  49. crypticorn/auth/main.py +45 -0
  50. crypticorn/client.py +46 -8
  51. crypticorn/common/__init__.py +5 -0
  52. crypticorn/common/auth.py +43 -0
  53. crypticorn/common/auth_client.py +163 -0
  54. crypticorn/common/errors.py +432 -0
  55. crypticorn/common/scopes.py +29 -0
  56. crypticorn/common/urls.py +25 -0
  57. crypticorn/hive/__init__.py +2 -1
  58. crypticorn/hive/client/__init__.py +57 -0
  59. crypticorn/hive/client/api/__init__.py +6 -0
  60. crypticorn/hive/client/api/data_api.py +594 -0
  61. crypticorn/hive/client/api/models_api.py +1680 -0
  62. crypticorn/hive/client/api/status_api.py +263 -0
  63. crypticorn/hive/client/api_client.py +758 -0
  64. crypticorn/hive/client/api_response.py +20 -0
  65. crypticorn/hive/client/configuration.py +612 -0
  66. crypticorn/hive/client/exceptions.py +220 -0
  67. crypticorn/hive/client/models/__init__.py +38 -0
  68. crypticorn/hive/client/models/coins.py +44 -0
  69. crypticorn/hive/client/models/data_download_response.py +113 -0
  70. crypticorn/hive/client/models/data_info.py +115 -0
  71. crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
  72. crypticorn/hive/client/models/data_version.py +35 -0
  73. crypticorn/hive/client/models/download_links.py +91 -0
  74. crypticorn/hive/client/models/evaluation.py +86 -0
  75. crypticorn/hive/client/models/evaluation_response.py +85 -0
  76. crypticorn/hive/client/models/feature_size.py +36 -0
  77. crypticorn/hive/client/models/http_validation_error.py +99 -0
  78. crypticorn/hive/client/models/model.py +133 -0
  79. crypticorn/hive/client/models/model_create.py +93 -0
  80. crypticorn/hive/client/models/model_status.py +35 -0
  81. crypticorn/hive/client/models/model_update.py +83 -0
  82. crypticorn/hive/client/models/target.py +36 -0
  83. crypticorn/hive/client/models/target_type.py +35 -0
  84. crypticorn/hive/client/models/validation_error.py +105 -0
  85. crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
  86. crypticorn/hive/client/py.typed +0 -0
  87. crypticorn/hive/client/rest.py +195 -0
  88. crypticorn/hive/main.py +27 -100
  89. crypticorn/klines/client/__init__.py +21 -7
  90. crypticorn/klines/client/api/__init__.py +0 -1
  91. crypticorn/klines/client/api/funding_rates_api.py +90 -79
  92. crypticorn/klines/client/api/health_check_api.py +29 -45
  93. crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
  94. crypticorn/klines/client/api/symbols_api.py +36 -54
  95. crypticorn/klines/client/api/udf_api.py +228 -352
  96. crypticorn/klines/client/api_client.py +106 -148
  97. crypticorn/klines/client/api_response.py +2 -3
  98. crypticorn/klines/client/configuration.py +64 -50
  99. crypticorn/klines/client/exceptions.py +20 -16
  100. crypticorn/klines/client/models/__init__.py +21 -7
  101. crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
  102. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
  103. crypticorn/klines/client/models/base_response_list_str.py +16 -14
  104. crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
  105. crypticorn/klines/client/models/error_response.py +23 -15
  106. crypticorn/klines/client/models/exchange.py +11 -11
  107. crypticorn/klines/client/models/funding_rate_response.py +11 -11
  108. crypticorn/klines/client/models/health_check_response.py +14 -12
  109. crypticorn/klines/client/models/history_error_response.py +11 -11
  110. crypticorn/klines/client/models/history_no_data_response.py +16 -16
  111. crypticorn/klines/client/models/history_success_response.py +16 -16
  112. crypticorn/klines/client/models/http_validation_error.py +14 -10
  113. crypticorn/klines/client/models/market.py +2 -4
  114. crypticorn/klines/client/models/ohlcv_response.py +22 -15
  115. crypticorn/klines/client/models/resolution.py +5 -7
  116. crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
  117. crypticorn/klines/client/models/search_symbol_response.py +22 -15
  118. crypticorn/klines/client/models/sort_direction.py +2 -4
  119. crypticorn/klines/client/models/symbol_group_response.py +5 -9
  120. crypticorn/klines/client/models/symbol_info_response.py +40 -24
  121. crypticorn/klines/client/models/symbol_type.py +5 -10
  122. crypticorn/klines/client/models/timeframe.py +5 -7
  123. crypticorn/klines/client/models/udf_config_response.py +60 -21
  124. crypticorn/klines/client/models/validation_error.py +19 -13
  125. crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
  126. crypticorn/klines/client/rest.py +30 -41
  127. crypticorn/klines/main.py +52 -15
  128. crypticorn/pay/__init__.py +2 -0
  129. crypticorn/pay/client/__init__.py +52 -0
  130. crypticorn/pay/client/api/__init__.py +7 -0
  131. crypticorn/pay/client/api/now_payments_api.py +813 -0
  132. crypticorn/pay/client/api/payments_api.py +799 -0
  133. crypticorn/pay/client/api/products_api.py +891 -0
  134. crypticorn/pay/client/api/status_api.py +260 -0
  135. crypticorn/pay/client/api_client.py +758 -0
  136. crypticorn/pay/client/api_response.py +20 -0
  137. crypticorn/pay/client/configuration.py +612 -0
  138. crypticorn/pay/client/exceptions.py +220 -0
  139. crypticorn/pay/client/models/__init__.py +32 -0
  140. crypticorn/pay/client/models/api_status_res.py +83 -0
  141. crypticorn/pay/client/models/combined_payment_history.py +101 -0
  142. crypticorn/pay/client/models/create_invoice_req.py +188 -0
  143. crypticorn/pay/client/models/create_invoice_res.py +188 -0
  144. crypticorn/pay/client/models/currency.py +165 -0
  145. crypticorn/pay/client/models/estimate_price_req.py +91 -0
  146. crypticorn/pay/client/models/estimate_price_res.py +102 -0
  147. crypticorn/pay/client/models/get_currencies_res.py +99 -0
  148. crypticorn/pay/client/models/get_payment_status_res.py +222 -0
  149. crypticorn/pay/client/models/get_payments_list_res.py +109 -0
  150. crypticorn/pay/client/models/http_validation_error.py +99 -0
  151. crypticorn/pay/client/models/min_amount_req.py +124 -0
  152. crypticorn/pay/client/models/min_amount_res.py +105 -0
  153. crypticorn/pay/client/models/now_api_status_res.py +83 -0
  154. crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
  155. crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
  156. crypticorn/pay/client/models/now_fee_structure.py +104 -0
  157. crypticorn/pay/client/models/now_payment_model.py +124 -0
  158. crypticorn/pay/client/models/now_payment_status.py +42 -0
  159. crypticorn/pay/client/models/now_webhook_payload.py +181 -0
  160. crypticorn/pay/client/models/payment.py +231 -0
  161. crypticorn/pay/client/models/payment_status.py +40 -0
  162. crypticorn/pay/client/models/product.py +87 -0
  163. crypticorn/pay/client/models/product_model.py +119 -0
  164. crypticorn/pay/client/models/product_subs_model.py +108 -0
  165. crypticorn/pay/client/models/services.py +34 -0
  166. crypticorn/pay/client/models/unified_payment_model.py +112 -0
  167. crypticorn/pay/client/models/validation_error.py +105 -0
  168. crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
  169. crypticorn/pay/client/py.typed +0 -0
  170. crypticorn/pay/client/rest.py +195 -0
  171. crypticorn/pay/main.py +35 -0
  172. crypticorn/trade/client/__init__.py +9 -4
  173. crypticorn/trade/client/api/__init__.py +0 -1
  174. crypticorn/trade/client/api/api_keys_api.py +203 -304
  175. crypticorn/trade/client/api/bots_api.py +177 -250
  176. crypticorn/trade/client/api/exchanges_api.py +38 -57
  177. crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
  178. crypticorn/trade/client/api/notifications_api.py +247 -364
  179. crypticorn/trade/client/api/orders_api.py +44 -63
  180. crypticorn/trade/client/api/status_api.py +35 -53
  181. crypticorn/trade/client/api/strategies_api.py +852 -64
  182. crypticorn/trade/client/api/trading_actions_api.py +126 -203
  183. crypticorn/trade/client/api_client.py +115 -154
  184. crypticorn/trade/client/api_response.py +2 -3
  185. crypticorn/trade/client/configuration.py +128 -90
  186. crypticorn/trade/client/exceptions.py +21 -17
  187. crypticorn/trade/client/models/__init__.py +9 -4
  188. crypticorn/trade/client/models/action_model.py +114 -50
  189. crypticorn/trade/client/models/api_error_identifier.py +60 -51
  190. crypticorn/trade/client/models/api_error_level.py +37 -0
  191. crypticorn/trade/client/models/api_error_type.py +37 -0
  192. crypticorn/trade/client/models/api_key_model.py +49 -28
  193. crypticorn/trade/client/models/bot_model.py +76 -31
  194. crypticorn/trade/client/models/bot_status.py +37 -0
  195. crypticorn/trade/client/models/exchange.py +3 -5
  196. crypticorn/trade/client/models/execution_ids.py +14 -14
  197. crypticorn/trade/client/models/futures_balance.py +39 -23
  198. crypticorn/trade/client/models/futures_trading_action.py +98 -46
  199. crypticorn/trade/client/models/http_validation_error.py +15 -11
  200. crypticorn/trade/client/models/margin_mode.py +3 -5
  201. crypticorn/trade/client/models/market_type.py +3 -5
  202. crypticorn/trade/client/models/notification_model.py +60 -27
  203. crypticorn/trade/client/models/notification_type.py +4 -6
  204. crypticorn/trade/client/models/order_model.py +125 -65
  205. crypticorn/trade/client/models/order_status.py +6 -8
  206. crypticorn/trade/client/models/post_futures_action.py +16 -12
  207. crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
  208. crypticorn/trade/client/models/strategy_model.py +66 -27
  209. crypticorn/trade/client/models/strategy_model_input.py +160 -0
  210. crypticorn/trade/client/models/strategy_model_output.py +160 -0
  211. crypticorn/trade/client/models/tpsl.py +35 -21
  212. crypticorn/trade/client/models/trading_action_type.py +5 -7
  213. crypticorn/trade/client/models/update_notification.py +17 -13
  214. crypticorn/trade/client/models/validation_error.py +20 -14
  215. crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
  216. crypticorn/trade/client/rest.py +108 -170
  217. crypticorn/trade/main.py +26 -19
  218. crypticorn-2.0.0.dist-info/METADATA +74 -0
  219. crypticorn-2.0.0.dist-info/RECORD +226 -0
  220. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
  221. crypticorn/hive/requirements.txt +0 -4
  222. crypticorn/hive/utils.py +0 -109
  223. crypticorn/klines/requirements.txt +0 -4
  224. crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
  225. crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
  226. crypticorn/klines/test/test_base_response_list_str.py +0 -56
  227. crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
  228. crypticorn/klines/test/test_error_response.py +0 -57
  229. crypticorn/klines/test/test_exchange.py +0 -56
  230. crypticorn/klines/test/test_funding_rate_response.py +0 -56
  231. crypticorn/klines/test/test_funding_rates_api.py +0 -38
  232. crypticorn/klines/test/test_health_check_api.py +0 -38
  233. crypticorn/klines/test/test_health_check_response.py +0 -52
  234. crypticorn/klines/test/test_history_error_response.py +0 -53
  235. crypticorn/klines/test/test_history_no_data_response.py +0 -69
  236. crypticorn/klines/test/test_history_success_response.py +0 -87
  237. crypticorn/klines/test/test_http_validation_error.py +0 -58
  238. crypticorn/klines/test/test_market.py +0 -33
  239. crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
  240. crypticorn/klines/test/test_ohlcv_response.py +0 -86
  241. crypticorn/klines/test/test_resolution.py +0 -33
  242. crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
  243. crypticorn/klines/test/test_search_symbol_response.py +0 -62
  244. crypticorn/klines/test/test_sort_direction.py +0 -33
  245. crypticorn/klines/test/test_symbol_group_response.py +0 -53
  246. crypticorn/klines/test/test_symbol_info_response.py +0 -84
  247. crypticorn/klines/test/test_symbol_type.py +0 -54
  248. crypticorn/klines/test/test_symbols_api.py +0 -38
  249. crypticorn/klines/test/test_timeframe.py +0 -33
  250. crypticorn/klines/test/test_udf_api.py +0 -80
  251. crypticorn/klines/test/test_udf_config_response.py +0 -95
  252. crypticorn/klines/test/test_validation_error.py +0 -60
  253. crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
  254. crypticorn/trade/requirements.txt +0 -4
  255. crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
  256. crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
  257. crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
  258. /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
  259. {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,83 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Payment API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class NowAPIStatusRes(BaseModel):
27
+ """
28
+ Response for the API status.
29
+ """ # noqa: E501
30
+
31
+ message: StrictStr = Field(description="API status message")
32
+ __properties: ClassVar[List[str]] = ["message"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of NowAPIStatusRes from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of NowAPIStatusRes from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({"message": obj.get("message")})
83
+ return _obj
@@ -0,0 +1,188 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Payment API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import (
21
+ BaseModel,
22
+ ConfigDict,
23
+ Field,
24
+ StrictBool,
25
+ StrictFloat,
26
+ StrictInt,
27
+ StrictStr,
28
+ )
29
+ from typing import Any, ClassVar, Dict, List, Optional, Union
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+
34
+ class NowCreateInvoiceReq(BaseModel):
35
+ """
36
+ Request model for creating a payment invoice. Creates a payment link where the customer can complete the payment. With this method, the customer is required to follow the generated url to complete the payment. https://documenter.getpostman.com/view/7907941/2s93JusNJt#f5e4e645-dce2-4b06-b2ca-2a29aaa5e845
37
+ """ # noqa: E501
38
+
39
+ price_amount: Union[StrictFloat, StrictInt] = Field(
40
+ description="Amount to pay in fiat currency"
41
+ )
42
+ price_currency: StrictStr = Field(
43
+ description="Fiat currency for the price (usd, eur, etc)"
44
+ )
45
+ pay_currency: Optional[StrictStr] = None
46
+ ipn_callback_url: Optional[StrictStr] = None
47
+ order_id: Optional[StrictStr] = None
48
+ order_description: Optional[StrictStr] = None
49
+ success_url: Optional[StrictStr] = None
50
+ cancel_url: Optional[StrictStr] = None
51
+ partially_paid_url: Optional[StrictStr] = None
52
+ is_fixed_rate: Optional[StrictBool] = None
53
+ is_fee_paid_by_user: Optional[StrictBool] = None
54
+ __properties: ClassVar[List[str]] = [
55
+ "price_amount",
56
+ "price_currency",
57
+ "pay_currency",
58
+ "ipn_callback_url",
59
+ "order_id",
60
+ "order_description",
61
+ "success_url",
62
+ "cancel_url",
63
+ "partially_paid_url",
64
+ "is_fixed_rate",
65
+ "is_fee_paid_by_user",
66
+ ]
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+ def to_str(self) -> str:
75
+ """Returns the string representation of the model using alias"""
76
+ return pprint.pformat(self.model_dump(by_alias=True))
77
+
78
+ def to_json(self) -> str:
79
+ """Returns the JSON representation of the model using alias"""
80
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
+ return json.dumps(self.to_dict())
82
+
83
+ @classmethod
84
+ def from_json(cls, json_str: str) -> Optional[Self]:
85
+ """Create an instance of NowCreateInvoiceReq from a JSON string"""
86
+ return cls.from_dict(json.loads(json_str))
87
+
88
+ def to_dict(self) -> Dict[str, Any]:
89
+ """Return the dictionary representation of the model using alias.
90
+
91
+ This has the following differences from calling pydantic's
92
+ `self.model_dump(by_alias=True)`:
93
+
94
+ * `None` is only added to the output dict for nullable fields that
95
+ were set at model initialization. Other fields with value `None`
96
+ are ignored.
97
+ """
98
+ excluded_fields: Set[str] = set([])
99
+
100
+ _dict = self.model_dump(
101
+ by_alias=True,
102
+ exclude=excluded_fields,
103
+ exclude_none=True,
104
+ )
105
+ # set to None if pay_currency (nullable) is None
106
+ # and model_fields_set contains the field
107
+ if self.pay_currency is None and "pay_currency" in self.model_fields_set:
108
+ _dict["pay_currency"] = None
109
+
110
+ # set to None if ipn_callback_url (nullable) is None
111
+ # and model_fields_set contains the field
112
+ if (
113
+ self.ipn_callback_url is None
114
+ and "ipn_callback_url" in self.model_fields_set
115
+ ):
116
+ _dict["ipn_callback_url"] = None
117
+
118
+ # set to None if order_id (nullable) is None
119
+ # and model_fields_set contains the field
120
+ if self.order_id is None and "order_id" in self.model_fields_set:
121
+ _dict["order_id"] = None
122
+
123
+ # set to None if order_description (nullable) is None
124
+ # and model_fields_set contains the field
125
+ if (
126
+ self.order_description is None
127
+ and "order_description" in self.model_fields_set
128
+ ):
129
+ _dict["order_description"] = None
130
+
131
+ # set to None if success_url (nullable) is None
132
+ # and model_fields_set contains the field
133
+ if self.success_url is None and "success_url" in self.model_fields_set:
134
+ _dict["success_url"] = None
135
+
136
+ # set to None if cancel_url (nullable) is None
137
+ # and model_fields_set contains the field
138
+ if self.cancel_url is None and "cancel_url" in self.model_fields_set:
139
+ _dict["cancel_url"] = None
140
+
141
+ # set to None if partially_paid_url (nullable) is None
142
+ # and model_fields_set contains the field
143
+ if (
144
+ self.partially_paid_url is None
145
+ and "partially_paid_url" in self.model_fields_set
146
+ ):
147
+ _dict["partially_paid_url"] = None
148
+
149
+ # set to None if is_fixed_rate (nullable) is None
150
+ # and model_fields_set contains the field
151
+ if self.is_fixed_rate is None and "is_fixed_rate" in self.model_fields_set:
152
+ _dict["is_fixed_rate"] = None
153
+
154
+ # set to None if is_fee_paid_by_user (nullable) is None
155
+ # and model_fields_set contains the field
156
+ if (
157
+ self.is_fee_paid_by_user is None
158
+ and "is_fee_paid_by_user" in self.model_fields_set
159
+ ):
160
+ _dict["is_fee_paid_by_user"] = None
161
+
162
+ return _dict
163
+
164
+ @classmethod
165
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
166
+ """Create an instance of NowCreateInvoiceReq from a dict"""
167
+ if obj is None:
168
+ return None
169
+
170
+ if not isinstance(obj, dict):
171
+ return cls.model_validate(obj)
172
+
173
+ _obj = cls.model_validate(
174
+ {
175
+ "price_amount": obj.get("price_amount"),
176
+ "price_currency": obj.get("price_currency"),
177
+ "pay_currency": obj.get("pay_currency"),
178
+ "ipn_callback_url": obj.get("ipn_callback_url"),
179
+ "order_id": obj.get("order_id"),
180
+ "order_description": obj.get("order_description"),
181
+ "success_url": obj.get("success_url"),
182
+ "cancel_url": obj.get("cancel_url"),
183
+ "partially_paid_url": obj.get("partially_paid_url"),
184
+ "is_fixed_rate": obj.get("is_fixed_rate"),
185
+ "is_fee_paid_by_user": obj.get("is_fee_paid_by_user"),
186
+ }
187
+ )
188
+ return _obj
@@ -0,0 +1,188 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Payment API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class NowCreateInvoiceRes(BaseModel):
27
+ """
28
+ Response model for created invoice. https://documenter.getpostman.com/view/7907941/2s93JusNJt#f5e4e645-dce2-4b06-b2ca-2a29aaa5e845
29
+ """ # noqa: E501
30
+
31
+ id: StrictStr = Field(description="Invoice ID")
32
+ token_id: StrictStr = Field(description="Internal identifier")
33
+ order_id: Optional[StrictStr] = None
34
+ order_description: Optional[StrictStr] = None
35
+ price_amount: StrictStr = Field(description="Base price in fiat")
36
+ price_currency: StrictStr = Field(description="Ticker of base fiat currency")
37
+ pay_currency: Optional[StrictStr] = None
38
+ ipn_callback_url: Optional[StrictStr] = None
39
+ invoice_url: StrictStr = Field(description="Link to the payment page")
40
+ success_url: Optional[StrictStr] = None
41
+ cancel_url: Optional[StrictStr] = None
42
+ partially_paid_url: Optional[StrictStr] = None
43
+ payout_currency: Optional[StrictStr] = None
44
+ created_at: StrictStr = Field(description="Time of invoice creation")
45
+ updated_at: StrictStr = Field(description="Time of latest invoice update")
46
+ is_fixed_rate: StrictBool = Field(description="Fixed Rate option status")
47
+ is_fee_paid_by_user: StrictBool = Field(
48
+ description="Fee Paid By User option status"
49
+ )
50
+ __properties: ClassVar[List[str]] = [
51
+ "id",
52
+ "token_id",
53
+ "order_id",
54
+ "order_description",
55
+ "price_amount",
56
+ "price_currency",
57
+ "pay_currency",
58
+ "ipn_callback_url",
59
+ "invoice_url",
60
+ "success_url",
61
+ "cancel_url",
62
+ "partially_paid_url",
63
+ "payout_currency",
64
+ "created_at",
65
+ "updated_at",
66
+ "is_fixed_rate",
67
+ "is_fee_paid_by_user",
68
+ ]
69
+
70
+ model_config = ConfigDict(
71
+ populate_by_name=True,
72
+ validate_assignment=True,
73
+ protected_namespaces=(),
74
+ )
75
+
76
+ def to_str(self) -> str:
77
+ """Returns the string representation of the model using alias"""
78
+ return pprint.pformat(self.model_dump(by_alias=True))
79
+
80
+ def to_json(self) -> str:
81
+ """Returns the JSON representation of the model using alias"""
82
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
83
+ return json.dumps(self.to_dict())
84
+
85
+ @classmethod
86
+ def from_json(cls, json_str: str) -> Optional[Self]:
87
+ """Create an instance of NowCreateInvoiceRes from a JSON string"""
88
+ return cls.from_dict(json.loads(json_str))
89
+
90
+ def to_dict(self) -> Dict[str, Any]:
91
+ """Return the dictionary representation of the model using alias.
92
+
93
+ This has the following differences from calling pydantic's
94
+ `self.model_dump(by_alias=True)`:
95
+
96
+ * `None` is only added to the output dict for nullable fields that
97
+ were set at model initialization. Other fields with value `None`
98
+ are ignored.
99
+ """
100
+ excluded_fields: Set[str] = set([])
101
+
102
+ _dict = self.model_dump(
103
+ by_alias=True,
104
+ exclude=excluded_fields,
105
+ exclude_none=True,
106
+ )
107
+ # set to None if order_id (nullable) is None
108
+ # and model_fields_set contains the field
109
+ if self.order_id is None and "order_id" in self.model_fields_set:
110
+ _dict["order_id"] = None
111
+
112
+ # set to None if order_description (nullable) is None
113
+ # and model_fields_set contains the field
114
+ if (
115
+ self.order_description is None
116
+ and "order_description" in self.model_fields_set
117
+ ):
118
+ _dict["order_description"] = None
119
+
120
+ # set to None if pay_currency (nullable) is None
121
+ # and model_fields_set contains the field
122
+ if self.pay_currency is None and "pay_currency" in self.model_fields_set:
123
+ _dict["pay_currency"] = None
124
+
125
+ # set to None if ipn_callback_url (nullable) is None
126
+ # and model_fields_set contains the field
127
+ if (
128
+ self.ipn_callback_url is None
129
+ and "ipn_callback_url" in self.model_fields_set
130
+ ):
131
+ _dict["ipn_callback_url"] = None
132
+
133
+ # set to None if success_url (nullable) is None
134
+ # and model_fields_set contains the field
135
+ if self.success_url is None and "success_url" in self.model_fields_set:
136
+ _dict["success_url"] = None
137
+
138
+ # set to None if cancel_url (nullable) is None
139
+ # and model_fields_set contains the field
140
+ if self.cancel_url is None and "cancel_url" in self.model_fields_set:
141
+ _dict["cancel_url"] = None
142
+
143
+ # set to None if partially_paid_url (nullable) is None
144
+ # and model_fields_set contains the field
145
+ if (
146
+ self.partially_paid_url is None
147
+ and "partially_paid_url" in self.model_fields_set
148
+ ):
149
+ _dict["partially_paid_url"] = None
150
+
151
+ # set to None if payout_currency (nullable) is None
152
+ # and model_fields_set contains the field
153
+ if self.payout_currency is None and "payout_currency" in self.model_fields_set:
154
+ _dict["payout_currency"] = None
155
+
156
+ return _dict
157
+
158
+ @classmethod
159
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
160
+ """Create an instance of NowCreateInvoiceRes from a dict"""
161
+ if obj is None:
162
+ return None
163
+
164
+ if not isinstance(obj, dict):
165
+ return cls.model_validate(obj)
166
+
167
+ _obj = cls.model_validate(
168
+ {
169
+ "id": obj.get("id"),
170
+ "token_id": obj.get("token_id"),
171
+ "order_id": obj.get("order_id"),
172
+ "order_description": obj.get("order_description"),
173
+ "price_amount": obj.get("price_amount"),
174
+ "price_currency": obj.get("price_currency"),
175
+ "pay_currency": obj.get("pay_currency"),
176
+ "ipn_callback_url": obj.get("ipn_callback_url"),
177
+ "invoice_url": obj.get("invoice_url"),
178
+ "success_url": obj.get("success_url"),
179
+ "cancel_url": obj.get("cancel_url"),
180
+ "partially_paid_url": obj.get("partially_paid_url"),
181
+ "payout_currency": obj.get("payout_currency"),
182
+ "created_at": obj.get("created_at"),
183
+ "updated_at": obj.get("updated_at"),
184
+ "is_fixed_rate": obj.get("is_fixed_rate"),
185
+ "is_fee_paid_by_user": obj.get("is_fee_paid_by_user"),
186
+ }
187
+ )
188
+ return _obj
@@ -0,0 +1,104 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Payment API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+
26
+ class NowFeeStructure(BaseModel):
27
+ """
28
+ Fee structure for the payment
29
+ """ # noqa: E501
30
+
31
+ currency: StrictStr = Field(description="Currency of the fee")
32
+ deposit_fee: Union[StrictFloat, StrictInt] = Field(
33
+ description="Deposit fee amount", alias="depositFee"
34
+ )
35
+ service_fee: Union[StrictFloat, StrictInt] = Field(
36
+ description="Service fee amount", alias="serviceFee"
37
+ )
38
+ withdrawal_fee: Union[StrictFloat, StrictInt] = Field(
39
+ description="Withdrawal fee amount", alias="withdrawalFee"
40
+ )
41
+ __properties: ClassVar[List[str]] = [
42
+ "currency",
43
+ "depositFee",
44
+ "serviceFee",
45
+ "withdrawalFee",
46
+ ]
47
+
48
+ model_config = ConfigDict(
49
+ populate_by_name=True,
50
+ validate_assignment=True,
51
+ protected_namespaces=(),
52
+ )
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of NowFeeStructure from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ """
78
+ excluded_fields: Set[str] = set([])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of NowFeeStructure from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate(
97
+ {
98
+ "currency": obj.get("currency"),
99
+ "depositFee": obj.get("depositFee"),
100
+ "serviceFee": obj.get("serviceFee"),
101
+ "withdrawalFee": obj.get("withdrawalFee"),
102
+ }
103
+ )
104
+ return _obj
@@ -0,0 +1,124 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Payment API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from crypticorn.pay.client.models.now_payment_status import NowPaymentStatus
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+
27
+ class NowPaymentModel(BaseModel):
28
+ """
29
+ NowPaymentModel
30
+ """ # noqa: E501
31
+
32
+ id: StrictStr = Field(description="Product ID")
33
+ payment_id: StrictInt = Field(description="Unique payment identifier")
34
+ invoice_id: StrictInt = Field(description="Associated invoice ID")
35
+ product_id: StrictStr = Field(description="Product ID")
36
+ user_id: StrictStr = Field(description="User ID")
37
+ order_id: StrictStr = Field(description="Internal order ID")
38
+ paid_amount: Union[StrictFloat, StrictInt] = Field(
39
+ description="Actually paid amount"
40
+ )
41
+ pay_amount: Union[StrictFloat, StrictInt] = Field(description="Amount to pay")
42
+ pay_currency: StrictStr = Field(description="Payment currency")
43
+ status: NowPaymentStatus = Field(description="Current payment status")
44
+ updated_at: StrictInt = Field(
45
+ description="Payment last update timestamp in milliseconds"
46
+ )
47
+ __properties: ClassVar[List[str]] = [
48
+ "id",
49
+ "payment_id",
50
+ "invoice_id",
51
+ "product_id",
52
+ "user_id",
53
+ "order_id",
54
+ "paid_amount",
55
+ "pay_amount",
56
+ "pay_currency",
57
+ "status",
58
+ "updated_at",
59
+ ]
60
+
61
+ model_config = ConfigDict(
62
+ populate_by_name=True,
63
+ validate_assignment=True,
64
+ protected_namespaces=(),
65
+ )
66
+
67
+ def to_str(self) -> str:
68
+ """Returns the string representation of the model using alias"""
69
+ return pprint.pformat(self.model_dump(by_alias=True))
70
+
71
+ def to_json(self) -> str:
72
+ """Returns the JSON representation of the model using alias"""
73
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
74
+ return json.dumps(self.to_dict())
75
+
76
+ @classmethod
77
+ def from_json(cls, json_str: str) -> Optional[Self]:
78
+ """Create an instance of NowPaymentModel from a JSON string"""
79
+ return cls.from_dict(json.loads(json_str))
80
+
81
+ def to_dict(self) -> Dict[str, Any]:
82
+ """Return the dictionary representation of the model using alias.
83
+
84
+ This has the following differences from calling pydantic's
85
+ `self.model_dump(by_alias=True)`:
86
+
87
+ * `None` is only added to the output dict for nullable fields that
88
+ were set at model initialization. Other fields with value `None`
89
+ are ignored.
90
+ """
91
+ excluded_fields: Set[str] = set([])
92
+
93
+ _dict = self.model_dump(
94
+ by_alias=True,
95
+ exclude=excluded_fields,
96
+ exclude_none=True,
97
+ )
98
+ return _dict
99
+
100
+ @classmethod
101
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
+ """Create an instance of NowPaymentModel from a dict"""
103
+ if obj is None:
104
+ return None
105
+
106
+ if not isinstance(obj, dict):
107
+ return cls.model_validate(obj)
108
+
109
+ _obj = cls.model_validate(
110
+ {
111
+ "id": obj.get("id"),
112
+ "payment_id": obj.get("payment_id"),
113
+ "invoice_id": obj.get("invoice_id"),
114
+ "product_id": obj.get("product_id"),
115
+ "user_id": obj.get("user_id"),
116
+ "order_id": obj.get("order_id"),
117
+ "paid_amount": obj.get("paid_amount"),
118
+ "pay_amount": obj.get("pay_amount"),
119
+ "pay_currency": obj.get("pay_currency"),
120
+ "status": obj.get("status"),
121
+ "updated_at": obj.get("updated_at"),
122
+ }
123
+ )
124
+ return _obj