crypticorn 2.5.0rc5__py3-none-any.whl → 2.5.2__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 (144) hide show
  1. crypticorn/auth/main.py +2 -0
  2. crypticorn/client.py +60 -69
  3. crypticorn/common/__init__.py +3 -1
  4. crypticorn/common/auth.py +38 -20
  5. crypticorn/common/enums.py +4 -31
  6. crypticorn/common/errors.py +72 -17
  7. crypticorn/common/exceptions.py +29 -15
  8. crypticorn/common/mixins.py +37 -0
  9. crypticorn/common/status_router.py +42 -0
  10. crypticorn/common/urls.py +2 -1
  11. crypticorn/common/utils.py +9 -14
  12. crypticorn/hive/main.py +2 -0
  13. crypticorn/klines/client/__init__.py +10 -43
  14. crypticorn/klines/client/api/__init__.py +1 -1
  15. crypticorn/klines/client/api/change_in_timeframe_api.py +16 -31
  16. crypticorn/klines/client/api/funding_rates_api.py +8 -22
  17. crypticorn/klines/client/api/ohlcv_data_api.py +17 -38
  18. crypticorn/klines/client/api/{health_check_api.py → status_api.py} +18 -23
  19. crypticorn/klines/client/api/symbols_api.py +18 -34
  20. crypticorn/klines/client/api/udf_api.py +48 -59
  21. crypticorn/klines/client/api_client.py +1 -1
  22. crypticorn/klines/client/configuration.py +1 -1
  23. crypticorn/klines/client/exceptions.py +1 -1
  24. crypticorn/klines/client/models/__init__.py +9 -42
  25. crypticorn/klines/client/models/{change_in_timeframe_response.py → change_in_timeframe.py} +5 -5
  26. crypticorn/klines/client/models/{error_response.py → exception_detail.py} +25 -20
  27. crypticorn/klines/client/models/{funding_rate_response.py → funding_rate.py} +5 -5
  28. crypticorn/klines/client/models/{ohlcv_response.py → ohlcv_history.py} +14 -14
  29. crypticorn/klines/client/models/resolution.py +1 -1
  30. crypticorn/klines/client/models/{exchange.py → search_symbol.py} +17 -13
  31. crypticorn/klines/client/models/sort_direction.py +1 -1
  32. crypticorn/klines/client/models/{symbol_group_response.py → symbol_group.py} +5 -5
  33. crypticorn/klines/client/models/{symbol_info_response.py → symbol_info.py} +5 -5
  34. crypticorn/klines/client/models/symbol_type.py +1 -1
  35. crypticorn/klines/client/models/timeframe.py +1 -1
  36. crypticorn/klines/client/models/{udf_config_response.py → udf_config.py} +7 -19
  37. crypticorn/klines/client/rest.py +1 -1
  38. crypticorn/klines/main.py +40 -23
  39. crypticorn/metrics/client/__init__.py +3 -22
  40. crypticorn/metrics/client/api/__init__.py +1 -1
  41. crypticorn/metrics/client/api/exchanges_api.py +53 -97
  42. crypticorn/metrics/client/api/indicators_api.py +26 -52
  43. crypticorn/metrics/client/api/logs_api.py +8 -23
  44. crypticorn/metrics/client/api/marketcap_api.py +36 -88
  45. crypticorn/metrics/client/api/markets_api.py +26 -55
  46. crypticorn/metrics/client/api/{health_check_api.py → status_api.py} +18 -23
  47. crypticorn/metrics/client/api/tokens_api.py +7 -21
  48. crypticorn/metrics/client/api_client.py +1 -1
  49. crypticorn/metrics/client/configuration.py +1 -1
  50. crypticorn/metrics/client/exceptions.py +1 -1
  51. crypticorn/metrics/client/models/__init__.py +2 -21
  52. crypticorn/metrics/client/models/{error_response.py → exception_detail.py} +25 -20
  53. crypticorn/metrics/client/models/severity.py +1 -1
  54. crypticorn/metrics/client/models/time_interval.py +1 -1
  55. crypticorn/metrics/client/models/trading_status.py +1 -1
  56. crypticorn/metrics/client/rest.py +1 -1
  57. crypticorn/metrics/main.py +51 -43
  58. crypticorn/pay/main.py +2 -0
  59. crypticorn/trade/client/__init__.py +1 -5
  60. crypticorn/trade/client/api/exchanges_api.py +6 -6
  61. crypticorn/trade/client/api/trading_actions_api.py +16 -15
  62. crypticorn/trade/client/models/__init__.py +1 -5
  63. crypticorn/trade/client/models/action_model.py +1 -2
  64. crypticorn/trade/client/models/bot_model.py +3 -7
  65. crypticorn/trade/client/models/exchange_key_model.py +2 -11
  66. crypticorn/trade/client/models/execution_ids.py +1 -1
  67. crypticorn/trade/client/models/futures_trading_action.py +1 -2
  68. crypticorn/trade/client/models/notification_model.py +3 -12
  69. crypticorn/trade/client/models/order_model.py +7 -21
  70. crypticorn/trade/client/models/spot_trading_action.py +230 -0
  71. crypticorn/trade/client/models/strategy_exchange_info.py +2 -3
  72. crypticorn/trade/client/models/strategy_model_input.py +1 -2
  73. crypticorn/trade/client/models/strategy_model_output.py +1 -2
  74. crypticorn/trade/client/models/tpsl.py +3 -1
  75. crypticorn/trade/main.py +2 -0
  76. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/METADATA +7 -5
  77. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/RECORD +81 -141
  78. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/WHEEL +1 -1
  79. crypticorn/common/sorter.py +0 -40
  80. crypticorn/klines/client/models/base_response_health_check_response.py +0 -114
  81. crypticorn/klines/client/models/base_response_list_change_in_timeframe_response.py +0 -123
  82. crypticorn/klines/client/models/base_response_list_funding_rate_response.py +0 -118
  83. crypticorn/klines/client/models/base_response_list_str.py +0 -106
  84. crypticorn/klines/client/models/base_response_ohlcv_response.py +0 -114
  85. crypticorn/klines/client/models/health_check_response.py +0 -91
  86. crypticorn/klines/client/models/history_error_response.py +0 -89
  87. crypticorn/klines/client/models/history_no_data_response.py +0 -99
  88. crypticorn/klines/client/models/history_success_response.py +0 -99
  89. crypticorn/klines/client/models/http_validation_error.py +0 -99
  90. crypticorn/klines/client/models/market.py +0 -35
  91. crypticorn/klines/client/models/market_type.py +0 -35
  92. crypticorn/klines/client/models/response_get_history_udf_history_get.py +0 -198
  93. crypticorn/klines/client/models/response_get_udf_history.py +0 -198
  94. crypticorn/klines/client/models/search_symbol_response.py +0 -104
  95. crypticorn/klines/client/models/validation_error.py +0 -105
  96. crypticorn/klines/client/models/validation_error_loc_inner.py +0 -159
  97. crypticorn/metrics/client/models/base_response_dict.py +0 -106
  98. crypticorn/metrics/client/models/base_response_health_check_response.py +0 -114
  99. crypticorn/metrics/client/models/base_response_list_dict.py +0 -106
  100. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +0 -118
  101. crypticorn/metrics/client/models/base_response_list_str.py +0 -106
  102. crypticorn/metrics/client/models/exchange_mapping.py +0 -134
  103. crypticorn/metrics/client/models/health_check_response.py +0 -91
  104. crypticorn/metrics/client/models/http_validation_error.py +0 -99
  105. crypticorn/metrics/client/models/market.py +0 -35
  106. crypticorn/metrics/client/models/market_type.py +0 -35
  107. crypticorn/metrics/client/models/validation_error.py +0 -105
  108. crypticorn/metrics/client/models/validation_error_loc_inner.py +0 -159
  109. crypticorn/pay/client/models/api_status_res.py +0 -83
  110. crypticorn/pay/client/models/body_create_now_invoice.py +0 -98
  111. crypticorn/pay/client/models/body_create_product.py +0 -98
  112. crypticorn/pay/client/models/body_get_products.py +0 -87
  113. crypticorn/pay/client/models/body_handle_now_webhook.py +0 -98
  114. crypticorn/pay/client/models/body_update_product.py +0 -98
  115. crypticorn/pay/client/models/combined_payment_history.py +0 -101
  116. crypticorn/pay/client/models/create_invoice_req.py +0 -188
  117. crypticorn/pay/client/models/create_invoice_res.py +0 -188
  118. crypticorn/pay/client/models/currency.py +0 -165
  119. crypticorn/pay/client/models/estimate_price_req.py +0 -91
  120. crypticorn/pay/client/models/estimate_price_res.py +0 -102
  121. crypticorn/pay/client/models/get_currencies_res.py +0 -99
  122. crypticorn/pay/client/models/get_payment_status_res.py +0 -222
  123. crypticorn/pay/client/models/get_payments_list_res.py +0 -109
  124. crypticorn/pay/client/models/min_amount_req.py +0 -124
  125. crypticorn/pay/client/models/min_amount_res.py +0 -105
  126. crypticorn/pay/client/models/now_fee_structure.py +0 -104
  127. crypticorn/pay/client/models/now_payment_model.py +0 -124
  128. crypticorn/pay/client/models/now_payment_status.py +0 -42
  129. crypticorn/pay/client/models/now_webhook_payload.py +0 -181
  130. crypticorn/pay/client/models/partial_product_update_model.py +0 -150
  131. crypticorn/pay/client/models/product.py +0 -87
  132. crypticorn/pay/client/models/product_model.py +0 -128
  133. crypticorn/pay/client/models/product_subs_model.py +0 -108
  134. crypticorn/pay/client/models/product_update_model.py +0 -150
  135. crypticorn/pay/client/models/unified_payment_model.py +0 -112
  136. crypticorn/trade/client/models/api_error_identifier.py +0 -104
  137. crypticorn/trade/client/models/api_error_level.py +0 -37
  138. crypticorn/trade/client/models/api_error_type.py +0 -37
  139. crypticorn/trade/client/models/api_key_model.py +0 -156
  140. crypticorn/trade/client/models/exchange.py +0 -35
  141. crypticorn/trade/client/models/market_type.py +0 -35
  142. /crypticorn/common/{pydantic.py → decorators.py} +0 -0
  143. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/entry_points.txt +0 -0
  144. {crypticorn-2.5.0rc5.dist-info → crypticorn-2.5.2.dist-info}/top_level.txt +0 -0
@@ -1,109 +0,0 @@
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, StrictInt
21
- from typing import Any, ClassVar, Dict, List
22
- from crypticorn.pay.client.models.payment import Payment
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
-
27
- class GetPaymentsListRes(BaseModel):
28
- """
29
- Response model for the list of payments. https://documenter.getpostman.com/view/7907941/2s93JusNJt#c38d2410-1523-4313-8764-0043ba1cb24f
30
- """ # noqa: E501
31
-
32
- data: List[Payment] = Field(description="List of payments")
33
- limit: StrictInt = Field(description="Number of records per page")
34
- page: StrictInt = Field(description="Current page number")
35
- pages_count: StrictInt = Field(
36
- description="Total number of pages", alias="pagesCount"
37
- )
38
- total: StrictInt = Field(description="Total number of records")
39
- __properties: ClassVar[List[str]] = ["data", "limit", "page", "pagesCount", "total"]
40
-
41
- model_config = ConfigDict(
42
- populate_by_name=True,
43
- validate_assignment=True,
44
- protected_namespaces=(),
45
- )
46
-
47
- def to_str(self) -> str:
48
- """Returns the string representation of the model using alias"""
49
- return pprint.pformat(self.model_dump(by_alias=True))
50
-
51
- def to_json(self) -> str:
52
- """Returns the JSON representation of the model using alias"""
53
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
- return json.dumps(self.to_dict())
55
-
56
- @classmethod
57
- def from_json(cls, json_str: str) -> Optional[Self]:
58
- """Create an instance of GetPaymentsListRes from a JSON string"""
59
- return cls.from_dict(json.loads(json_str))
60
-
61
- def to_dict(self) -> Dict[str, Any]:
62
- """Return the dictionary representation of the model using alias.
63
-
64
- This has the following differences from calling pydantic's
65
- `self.model_dump(by_alias=True)`:
66
-
67
- * `None` is only added to the output dict for nullable fields that
68
- were set at model initialization. Other fields with value `None`
69
- are ignored.
70
- """
71
- excluded_fields: Set[str] = set([])
72
-
73
- _dict = self.model_dump(
74
- by_alias=True,
75
- exclude=excluded_fields,
76
- exclude_none=True,
77
- )
78
- # override the default output from pydantic by calling `to_dict()` of each item in data (list)
79
- _items = []
80
- if self.data:
81
- for _item_data in self.data:
82
- if _item_data:
83
- _items.append(_item_data.to_dict())
84
- _dict["data"] = _items
85
- return _dict
86
-
87
- @classmethod
88
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
- """Create an instance of GetPaymentsListRes 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
- "data": (
99
- [Payment.from_dict(_item) for _item in obj["data"]]
100
- if obj.get("data") is not None
101
- else None
102
- ),
103
- "limit": obj.get("limit"),
104
- "page": obj.get("page"),
105
- "pagesCount": obj.get("pagesCount"),
106
- "total": obj.get("total"),
107
- }
108
- )
109
- return _obj
@@ -1,124 +0,0 @@
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 MinAmountReq(BaseModel):
27
- """
28
- Get the minimum payment amount for a specific currency pair. https://documenter.getpostman.com/view/7907941/2s93JusNJt#ce3fe3a3-00cd-4df2-bfba-641fde741da7 You can provide both currencies in the pair or just currency_from. If only currency_from is provided, the minimum payment amount will be calculated for currency_from and the default currency specified in Payment Settings. You can specify a fiat currency in currency_from to calculate the minimum payment in that fiat currency. The fiat_equivalent field can be added to get the fiat equivalent of the minimum amount. The is_fixed_rate and is_fee_paid_by_user parameters allow you to see current minimal amounts for corresponding flows, which may differ from the standard flow. For multiple outcome wallets, the minimum amount is calculated based on the payment routing logic.
29
- """ # noqa: E501
30
-
31
- currency_from: StrictStr = Field(description="Payin currency")
32
- currency_to: Optional[StrictStr] = None
33
- fiat_equivalent: Optional[StrictStr] = None
34
- is_fixed_rate: Optional[StrictBool] = None
35
- is_fee_paid_by_user: Optional[StrictBool] = None
36
- __properties: ClassVar[List[str]] = [
37
- "currency_from",
38
- "currency_to",
39
- "fiat_equivalent",
40
- "is_fixed_rate",
41
- "is_fee_paid_by_user",
42
- ]
43
-
44
- model_config = ConfigDict(
45
- populate_by_name=True,
46
- validate_assignment=True,
47
- protected_namespaces=(),
48
- )
49
-
50
- def to_str(self) -> str:
51
- """Returns the string representation of the model using alias"""
52
- return pprint.pformat(self.model_dump(by_alias=True))
53
-
54
- def to_json(self) -> str:
55
- """Returns the JSON representation of the model using alias"""
56
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
- return json.dumps(self.to_dict())
58
-
59
- @classmethod
60
- def from_json(cls, json_str: str) -> Optional[Self]:
61
- """Create an instance of MinAmountReq from a JSON string"""
62
- return cls.from_dict(json.loads(json_str))
63
-
64
- def to_dict(self) -> Dict[str, Any]:
65
- """Return the dictionary representation of the model using alias.
66
-
67
- This has the following differences from calling pydantic's
68
- `self.model_dump(by_alias=True)`:
69
-
70
- * `None` is only added to the output dict for nullable fields that
71
- were set at model initialization. Other fields with value `None`
72
- are ignored.
73
- """
74
- excluded_fields: Set[str] = set([])
75
-
76
- _dict = self.model_dump(
77
- by_alias=True,
78
- exclude=excluded_fields,
79
- exclude_none=True,
80
- )
81
- # set to None if currency_to (nullable) is None
82
- # and model_fields_set contains the field
83
- if self.currency_to is None and "currency_to" in self.model_fields_set:
84
- _dict["currency_to"] = None
85
-
86
- # set to None if fiat_equivalent (nullable) is None
87
- # and model_fields_set contains the field
88
- if self.fiat_equivalent is None and "fiat_equivalent" in self.model_fields_set:
89
- _dict["fiat_equivalent"] = None
90
-
91
- # set to None if is_fixed_rate (nullable) is None
92
- # and model_fields_set contains the field
93
- if self.is_fixed_rate is None and "is_fixed_rate" in self.model_fields_set:
94
- _dict["is_fixed_rate"] = None
95
-
96
- # set to None if is_fee_paid_by_user (nullable) is None
97
- # and model_fields_set contains the field
98
- if (
99
- self.is_fee_paid_by_user is None
100
- and "is_fee_paid_by_user" in self.model_fields_set
101
- ):
102
- _dict["is_fee_paid_by_user"] = None
103
-
104
- return _dict
105
-
106
- @classmethod
107
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
- """Create an instance of MinAmountReq from a dict"""
109
- if obj is None:
110
- return None
111
-
112
- if not isinstance(obj, dict):
113
- return cls.model_validate(obj)
114
-
115
- _obj = cls.model_validate(
116
- {
117
- "currency_from": obj.get("currency_from"),
118
- "currency_to": obj.get("currency_to"),
119
- "fiat_equivalent": obj.get("fiat_equivalent"),
120
- "is_fixed_rate": obj.get("is_fixed_rate"),
121
- "is_fee_paid_by_user": obj.get("is_fee_paid_by_user"),
122
- }
123
- )
124
- return _obj
@@ -1,105 +0,0 @@
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, Optional, Union
22
- from typing import Optional, Set
23
- from typing_extensions import Self
24
-
25
-
26
- class MinAmountRes(BaseModel):
27
- """
28
- Response for the minimum payment amount for a specific currency pair. https://documenter.getpostman.com/view/7907941/2s93JusNJt#ce3fe3a3-00cd-4df2-bfba-641fde741da7
29
- """ # noqa: E501
30
-
31
- currency_from: StrictStr = Field(description="Payin currency")
32
- currency_to: StrictStr = Field(description="Outcome currency")
33
- min_amount: Union[StrictFloat, StrictInt] = Field(
34
- description="Minimal amount for payment using mentioned currencies"
35
- )
36
- fiat_equivalent: Optional[Union[StrictFloat, StrictInt]] = None
37
- __properties: ClassVar[List[str]] = [
38
- "currency_from",
39
- "currency_to",
40
- "min_amount",
41
- "fiat_equivalent",
42
- ]
43
-
44
- model_config = ConfigDict(
45
- populate_by_name=True,
46
- validate_assignment=True,
47
- protected_namespaces=(),
48
- )
49
-
50
- def to_str(self) -> str:
51
- """Returns the string representation of the model using alias"""
52
- return pprint.pformat(self.model_dump(by_alias=True))
53
-
54
- def to_json(self) -> str:
55
- """Returns the JSON representation of the model using alias"""
56
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
- return json.dumps(self.to_dict())
58
-
59
- @classmethod
60
- def from_json(cls, json_str: str) -> Optional[Self]:
61
- """Create an instance of MinAmountRes from a JSON string"""
62
- return cls.from_dict(json.loads(json_str))
63
-
64
- def to_dict(self) -> Dict[str, Any]:
65
- """Return the dictionary representation of the model using alias.
66
-
67
- This has the following differences from calling pydantic's
68
- `self.model_dump(by_alias=True)`:
69
-
70
- * `None` is only added to the output dict for nullable fields that
71
- were set at model initialization. Other fields with value `None`
72
- are ignored.
73
- """
74
- excluded_fields: Set[str] = set([])
75
-
76
- _dict = self.model_dump(
77
- by_alias=True,
78
- exclude=excluded_fields,
79
- exclude_none=True,
80
- )
81
- # set to None if fiat_equivalent (nullable) is None
82
- # and model_fields_set contains the field
83
- if self.fiat_equivalent is None and "fiat_equivalent" in self.model_fields_set:
84
- _dict["fiat_equivalent"] = None
85
-
86
- return _dict
87
-
88
- @classmethod
89
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
- """Create an instance of MinAmountRes from a dict"""
91
- if obj is None:
92
- return None
93
-
94
- if not isinstance(obj, dict):
95
- return cls.model_validate(obj)
96
-
97
- _obj = cls.model_validate(
98
- {
99
- "currency_from": obj.get("currency_from"),
100
- "currency_to": obj.get("currency_to"),
101
- "min_amount": obj.get("min_amount"),
102
- "fiat_equivalent": obj.get("fiat_equivalent"),
103
- }
104
- )
105
- return _obj
@@ -1,104 +0,0 @@
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
@@ -1,124 +0,0 @@
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
@@ -1,42 +0,0 @@
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 json
17
- from enum import Enum
18
- from typing_extensions import Self
19
-
20
-
21
- class NowPaymentStatus(str, Enum):
22
- """
23
- Payment status for the payment
24
- """
25
-
26
- """
27
- allowed enum values
28
- """
29
- WAITING = "waiting"
30
- CONFIRMING = "confirming"
31
- CONFIRMED = "confirmed"
32
- SENDING = "sending"
33
- PARTIALLY_PAID = "partially_paid"
34
- FINISHED = "finished"
35
- FAILED = "failed"
36
- REFUNDED = "refunded"
37
- EXPIRED = "expired"
38
-
39
- @classmethod
40
- def from_json(cls, json_str: str) -> Self:
41
- """Create an instance of NowPaymentStatus from a JSON string"""
42
- return cls(json.loads(json_str))